By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

Getting "Type Mismatch" error when opening form

DonRayner
Expert 100+
P: 489
This one has me stumped. I'm getting a "Type Mismatch" error on one of my forms when it's being opened. It's hapening before the forms "On Open" event, I stuck a msgbox in there to check and I'm getting the error before it opens.

The line of code that calls the form from another form is.

DoCmd.OpenForm "NonConformanceAdd",,,,acFormAdd,acDialog

I get the error, click ok, then the form opens and works exactly how it's supposed to. I even tried using

DoCmd.OpenForm "f_NonConformance_add" and setting the forms property to Dialog and Data Entry to yes but still get the same error message. grrrrrr

What I'm trying to accomplish is the following

1. Calibration of instrument is bad so I need to create a non-conformance report
2. Click on create non-conformance button
3. Non Conformance data entry form opens
4. When data entry form closes bring back autonumber or null if canceled
5. Update non-conformance number field using "me.control.value = variable"
6. If the field is still null then do nothing else
7. if the field now contains something then enable the form save button, disable undo and navigation buttons.

The realy important part is that once the non-conformance record is created the users have no choice but to save the recrod that they are working on.

Non-Conformance and Calibration are two seprate databases located on an SQL server.

Any suggestions as to what I'm doing wrong or another way to skin this cat would be appreciated.
Sep 18 '08 #1
Share this Question
Share on Google+
2 Replies


Megalog
Expert 100+
P: 378
Are you using a query or a SQL statement for the form's recordsource?
There might be a join it doenst like, or a Condition format that is causing the error. This type of error would show up before any form operations, like Open, etc.
Sep 18 '08 #2

DonRayner
Expert 100+
P: 489
Are you using a query or a SQL statement for the form's recordsource?
There might be a join it doen't like, or a Condition format that is causing the error. This type of error would show up before any form operations, like Open, etc.
Now that you mention it, this form is one that I just copied over from it's original database (didn't want to re-invent the wheel) and it does have a query and sql statements that are attached to a subform that uses some very complex calculations with GUID's to enable them to be used in the queries (God I hate those GUID's ).

I only linked over the tables that I actually needed to add to and disabled the controls that I didn't need. I'll delete the extra controls and code to see if that helps.

Thanks
Sep 18 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.