473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Getting "Type Mismatch" error when opening form

DonRayner
489 Expert 256MB
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
2 5566
Megalog
378 Expert 256MB
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
489 Expert 256MB
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

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

Similar topics

1
by: dmgauntt2002 | last post by:
I have some javascript ASP code that sets the expiry date on a cookie to five years from now. The code worked until today, when I got the following error message: Microsoft JScript runtime...
2
by: Andrew Proctor | last post by:
Hello This is not a big problem, but I was hoping someone a bit more knowlegable than I could explain something to me. I have a simple function behind a form which writes changed values to a...
3
by: emmaruwa | last post by:
The following VBA code, in Access 2003, is to make a button open and populate a form based on the Surname and Period_frm data on a previous form. However, i keep getting a type mismatch error...
1
by: ApexData | last post by:
Access2k I WAS getting the following error when using the MID function: Run Time Error '13' Type Mismatch I have a new single form, unbound with 1-button on it that uses the following code:...
5
by: Davros9 | last post by:
Trying to get Regular Expressions working....... ---------------- Public Function SepString(InField As String) As String ''seperates on space and comma Dim RE As New RegExp Dim Matches As...
17
imrosie
by: imrosie | last post by:
I've tried this string to Sum up payments, moving brackets and paren's different ways, I still get error 'type mismatch'....not sure why. Can anyone point me in the right direction?? thanks ...
10
by: dstorms | last post by:
Hi, I'm trying to create a button on a form that: 1. Takes the ComputerID from the form linked to Table 1, 2. Checks Table 2 for a matching ComputerID, and 3. Opens the query qryEditData, and...
3
by: martin DH | last post by:
I would definitely appreciate any help with this problem as soon as possible. Thanks! I have a report that should display the results of a query based on two tables (tblClient and tblResult,...
5
by: Knowlton | last post by:
I am trying to set the value of a varible using DLookup and keep getting a type mismatch error. Here is what I have: Dim lngPickupTrailer As Long 'get mileage where trailer was picked up...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.