Windows 10: Access Database Problem

Discus and support Access Database Problem in Windows 10 Software and Apps to solve the problem; I am developing an Access database for a local charity which teaches people to use the internet. One field is a tick box flagging that the user is a... Discussion in 'Windows 10 Software and Apps' started by robertd, Jan 16, 2018.

  1. robertd Win User

    Access Database Problem


    I am developing an Access database for a local charity which teaches people to use the internet. One field is a tick box flagging that the user is a Member. There are other categories of user (User, Tenant, One to One) and the charity later required a separate field listing that status and allowing multiple entries into the field. This is done via a Combo Box set to allow multiple entries. Their requirements allow various possibilities of entering inconsistent data (e.g. Tick box says Member but the combo box field does not include Member) I wrote code to check for such inconsistencies. However with the multiple entry combo box code does not recognise the .Value of the combo box field so it can't check if Member is included. If the combo box is set to only allow one entry the same code works as required and can see what the field contains. I cannot find a solution to this. Does anyone recognise why?

    :)
     
    robertd, Jan 16, 2018
    #1

  2. Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

    After update from SQLSERVER 2012 to 2014, I can no longer access production database from second PC on LAN. SQL Server 2014 Management Studio returns error number 229, severity 14 whenever I try to access the database. SQL server 2014 on PC where database
    resides has no problems with accessing the data.
     
    CharlesMaranto Jr, Jan 16, 2018
    #2
  3. Shenan Stanley, Jan 16, 2018
    #3
  4. bbinnard Win User

    Access Database Problem

    Make a separate Access demo file that has just the form and code you are having trouble with and post it somewhere it can be downloaded.
     
    bbinnard, Jan 16, 2018
    #4
  5. robertd Win User
    It will be difficult to post as you suggest, partly but not completely as it would reveal real data. Instead I am posting the relevant code error. It is described as "runtime error 13, type mismatch"

    Private Sub cmdConsistency_Click()
    Dim Cancel As Integer
    Call Check59_Exit(Cancel)
    'Call cmbPersonType_Exit(Cancel)
    Call PersonTypeID_Exit(Cancel)
    'If Check59.Value = False And cmbPersonType.Value = 1 Then
    'MsgBox "PersonType value is " & PersonTypeID.Value
    If Check59.Value = False And PersonTypeID.Value = "Member" Then
    MsgBox "Person Type is set to member but Member tick box is not set"
    End If
    If Check59.Value = True And PersonTypeID.Value <> "Member" Then
    MsgBox "Member tick box is set but PersonType is not Member"
    End If
    End Sub

    The section in bold is the type mismatch. Exactly the same code with the same data works fine when the field PersonTypeID is a combobox where only one value can be entered to the field.
     
    robertd, Jan 17, 2018
    #5
  6. bbinnard Win User
    This looks like some sort of compiler quirk to me. Try this (just a guess):

    Private Sub cmdConsistency_Click()
    Dim Cancel As Integer, x as String
    Call Check59_Exit(Cancel)
    'Call cmbPersonType_Exit(Cancel)
    Call PersonTypeID_Exit(Cancel)
    'If Check59.Value = False And cmbPersonType.Value = 1 Then
    'MsgBox "PersonType value is " & PersonTypeID.Valuex=PersonTypeID.Value
    x=PersonTypeID.Value
    If Check59.Value = False And x = "Member" Then
    MsgBox "Person Type is set to member but Member tick box is not set"
    End If
    If Check59.Value = True And x <> "Member" Then
    MsgBox "Member tick box is set but PersonType is not Member"
    End If
    End Sub
     
    bbinnard, Jan 17, 2018
    #6
  7. robertd Win User
    Thanks for that. Still the same problem. This time Debug flags the line x = PersonTypeID.Value as the type mismatch
     
    robertd, Jan 17, 2018
    #7
  8. nbcaldon Win User

    Access Database Problem

    As it says 'Type Mismatch', it looks as though you need:

    If Check59.Value = False And cstr$(PersonTypeID.Value) = "Member" Then

    Also, if PersonTypeID is a control on a form, why do need to put .Value, as Value should be the default?

    This is what I would use:If Check59.Value = False And cstr$(Me![PersonTypeID]) = "Member" Then
     
    nbcaldon, Jan 17, 2018
    #8
  9. robertd Win User
    I should mention that using a query returns the value of PersonTypeID.Value (but only shows the first entry in the case where multiple entries have been selected). So the query recognises PersonTypeID. Value but Visual Basic does not for a multiple entry combo Box (but does for a single entry Combo box)
     
    robertd, Jan 17, 2018
    #9
  10. robertd Win User
    Tried both of nbcaldon's suggestions. Both still give the same type mismatch. Thanks for the ideas.
     
    robertd, Jan 17, 2018
    #10
  11. nbcaldon Win User
    Maybe the value is null. Try testing for this first:

    if isnull(Me![PersonTypeID]) then stop

    and then check what is going on in the code.
     
    nbcaldon, Jan 17, 2018
    #11
  12. bbinnard Win User
    Is it returning a string at all? What does

    Dim x as Integer
    x = len(Me![PersonTypeID])

    give you?
     
    bbinnard, Jan 17, 2018
    #12
  13. robertd Win User

    Access Database Problem

    For a combo box set to allow multiple entries it generates a type mismatch. For a combo box set to allow only 1 entry it works fine. Text length is 6 for setting Member. This is the general situation. Everything woks correctly for single entry and generates the mismatch for multiple entry.

    all the best
     
    robertd, Jan 17, 2018
    #13
  14. nbcaldon Win User
    Hi robertd,

    First, I have to say Thank You for introducing me to Multi-value fields and Multi-value combo boxes.
    They look like a super idea, but I am finding the implementation a little confusing.
    My impression is that using a multi-value field is just a way of avoiding creating another little table in your database - one that would be easy to set up, understand and use. Multi-valued fields seem to be unique to Access and I would avoid using them.

    However, if you must...

    To get at the data held in the field, you need to use:
    Me!comboboxname.Text
    which will give you a comma separated list of the values stored in the field.

    You can also tell whether each option is selected by using:
    Me!comboboxname.Selected(n)
    where n is the index for the list. This will return True or False, but I have no idea how you know which index number relates to which value in the list - if you work this out, please let me know.

    Note that Me!comboboxname.Value does not seem to return anything useful. It is not Null, but neither does it appear to be a string or a number.
     
    nbcaldon, Jan 17, 2018
    #14
  15. robertd Win User
    Thanks for this. I have a big meeting tomorrow about the database but I will look at this ASAP
     
    robertd, Jan 17, 2018
    #15
Thema:

Access Database Problem

Loading...
  1. Access Database Problem - Similar Threads - Access Database Problem

  2. How to access an old WHS database.

    in Windows 10 Gaming
    How to access an old WHS database.: I have an old WHS server with a large database of archival files. This was the version where the database was separate from the backups so I just kept using it for file storage. Over time, the server has become invisible to other PCs on my network which are now Win10 and Win...
  3. How to access an old WHS database.

    in Windows 10 Software and Apps
    How to access an old WHS database.: I have an old WHS server with a large database of archival files. This was the version where the database was separate from the backups so I just kept using it for file storage. Over time, the server has become invisible to other PCs on my network which are now Win10 and Win...
  4. Database / CRM / MS Access software

    in Windows 10 Software and Apps
    Database / CRM / MS Access software: I have some MS Access experience and I really like the whole "build your own form / database / app" flexible concept. The flaw with Access, in my opinion, is the license cost and not being able to host it online. Does anybody have any recommendation on similar software that...
  5. Access database error

    in Windows 10 Software and Apps
    Access database error: I have an Access database, that I am running in Access from a O365 subscription. No one else accesses my database. I have a transaction function that executes an update statement when the main form loads. After that, I cannot do anything because I get a "You do not have...
  6. KB4484238 causing problems with Microsoft Access Database engine 2010 and making database...

    in Windows 10 Installation and Upgrade
    KB4484238 causing problems with Microsoft Access Database engine 2010 and making database...: Ever since I installed KB4484238, my Microsoft Access database has begun to bloat. The filesize gets excessively large and all my program is doing is polling the database every five seconds for data. I use a stored procedure to do this. Before KB4484238 was installed, there...
  7. Problem with KB4484127 and access database engine

    in Windows 10 Installation and Upgrade
    Problem with KB4484127 and access database engine: Hello, We have an desktop application in production. After windows update with KB4484127, the application can not connect to the database. the application has folowing details - MFC c++ application using msado25.h. - uses the connection string :...
  8. Access database error "Unable to open connection to database" in Windows 10 only

    in Windows 10 BSOD Crashes and Debugging
    Access database error "Unable to open connection to database" in Windows 10 only: I have a Visual Studio application that was custom written many years ago for me. It uses the Microsoft Access database (.mdb). In all previous version of Windows (XP to 7) it functions perfectly, In Windows 10 I get an error message "Unable to open connection to database"....
  9. Problem with Access database after KB4487017/KB4487026

    in Windows 10 Installation and Upgrade
    Problem with Access database after KB4487017/KB4487026: We use an Access 97 database for our applications as a master database, so we can easily destribute this to customers. We access this master database using Adox to get the tables and columns (fields), compare it to the live SQL database and make changes where necessary....
  10. Running Access databases

    in Windows 10 Support
    Running Access databases: Hey guys, I hope I'm in the right section but, here's my problem. I bought this tablet with 10 already installed. I then installed Office 2007. OK no problem so far (my spreadsheets run fine). But then I transferred over a couple of my Access 2007 databases. Each seemed to...

Users found this page by searching for:

  1. access database problem

    ,
  2. WHY DOES PAUSE/BREAK NOT WORK IN ACCESS QUERY