Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    B66 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    14

    Type mismatch error in a form

    Hello everyone!

    I am new to Access, so please bare with me. I have a form field that is a lookup to a table and multi select (multi valued). When I insert new values or update existing ones in this field, I get "type mismatch error" in the form. However the corresponding table is updated correctly. Furthermore if I do inserts/edits of this field from the table directly I don't get that message. Any ideas on what's going on and how I can get rid of this message in the form?

    Thanks!

  2. #2
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,225
    likely your rowsource for the form control is wrong

  3. #3
    B66 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    14
    Thank you for your help. I checked it. The rowsource for the field in the form is correct. The crazy thing is that the table gets updated with the correct selected values in the field. The problem is in the form. I just can't figure it out....

  4. #4
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,225
    what is the rowsource to your combo and the bound column property, plus the name and datatype of the bound field.

  5. #5
    B66 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    14
    The rowsource to the combo is a table (tblRiskMitigationType), the bound column property is 1, the name of the bound field is RiskMitigationType and the datatype is short text. This field is a LookUp field (multivalued) to another table called tblRisks. I want the user to be able to select more than one value when he enters records in the form frmRisks which updates the tblRisks. Hope this makes sense.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,833
    Since you are a new Access developer, I recommend you do not use Lookup fields. see this for more. Similarly multivalued fields are not a recommended approach. Create proper normalized tables and you can avoid the problems associated with these short cut/marketing approaches by M$oft. Bothe of these "features" are designed for new users, but have all sorts of baggage related to them.

    Read up on Normalization and database/table design.

    Tell us about your business in simple English and readers will help you with your design.

  7. #7
    B66 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    14
    Thank you Orange for your reply and the reference to the LookUp fileds.
    Ok, in plain English.
    a) There is a form connected to a table where the users entry data in various fields. In one field, which at the moment is a combo box, different actions are listed. The user is able to select more than one action. When I press Save record, "type mismatch error" appears and yet the table gets updated correctly. That's why I am confused as to why this error appears and what I can do about it.
    b) Another issue I have is that, when a user edits an EXISTING record, I would like to create a message box to prompt the user to fill in a comments box, which is a field in the form. Making this field "Required" doesn't solve my problem because it notifies the user about filling it in when he adds NEW records also.

    Thank you!

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,833
    If you are going to select multiple items from a list, then you should use a Listbox.

    When I asked you to describe your business in simple English, I am suggesting something along these lines.

    We are a small consulting company. We assist clients with Project planning and Risk Assessment. .....

    Client --->Project--->ProjectRisk<----Risk<---RiskType

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,863
    As Orange mentioned, the type mismatch is because of the lookup field. Selecting the lookup is retrieving the ordinal position, not the stuff humans look at and understand. Fixing and addressing the type mismatch is more difficult than fixing the data structure. In other words, normalizing the data structure will make developing your application much easier than constantly referring to the ordinal position of multivalue fields.

  10. #10
    B66 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    14
    Thank you. I am working on it as orange and you suggested. Any ideas on this? (Another issue I have is that, when a user edits an EXISTING record, I would like to create a message box to prompt the user to fill in a comments box, which is a field in the form. Making this field "Required" doesn't solve my problem because it notifies the user about filling it in when he adds NEW records also.)

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,833

  12. #12
    B66 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    14
    How do I do that?

  13. #13
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,833
    Go to the relationships window; do a printscreen (which will copy the current screen image to a buffer; open a graphics program (irfanview, Paint...);
    select a new file then paste.

  14. #14
    B66 is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    14
    Click image for larger version. 

Name:	Untitled1.jpg 
Views:	13 
Size:	53.7 KB 
ID:	25602

    Here you go.

  15. #15
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,833
    Could you please describe to reader WHAT the graphic in your latest post represents?
    Real simple, English terms.

    As per my earlier post

    When I asked you to describe your business in simple English, I am suggesting something along these lines.

    We are a small consulting company. We assist clients with Project planning and Risk Assessment. .....

    Possible table structure, but we need details of your business:
    Client --->Project--->ProjectRisk<----Risk<---RiskType

    All the picture tells me is

    2 tables, 1:1 link ?? What is the business context?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Type 13 (Type Mismatch) error
    By sdel_nevo in forum Programming
    Replies: 5
    Last Post: 01-22-2016, 10:01 AM
  2. Type Mismatch error... Please help...
    By craig1988 in forum Modules
    Replies: 5
    Last Post: 10-08-2015, 09:25 AM
  3. error 13 type mismatch
    By jkd in forum Programming
    Replies: 2
    Last Post: 04-19-2014, 09:46 PM
  4. Replies: 7
    Last Post: 07-24-2013, 02:01 PM
  5. Replies: 1
    Last Post: 05-11-2012, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums