Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create New Record Problem

Status
Not open for further replies.

MAPetry

Technical User
Aug 2, 2000
43
0
0
US
I have a main company form that has all company information i.e. address, phone, fax, contacts etc.
From there I want the user to be able to click the "FAX" or "Transmittal" button and have that open the associated form with the current company as the receiver of the fax or transmittal.
However I keep getting a "Type Mismatch" error no matter How I work this.
The fax form "Fax Receiver" field is set to be a lookup of the Comapny table Company ID. They both access the same piece of information and I do not understand why I keep getting mismatch error PLEASE HELP!
Following is the code I have:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Fax"
stLinkCriteria = "Forms![Fax]![ID] =" & Me!ID
DoCmd.OpenForm stDocName, , , acFormAdd, stLinkCriteria


Thanks MAP
 
Didn't you miss the sequence of arguments in OpenForm?

Should be
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
 
Thanks for your suggestions,

Data Type: Since the receiver data for the fax form is a lookup of the company in company table it defaults it to autonumber (which is company primary ID type). and may be my problem Hoever I still want people to be able to open the stand alone fax form and create a fax which would need lookup.

Command Line:
switching the command line still doesn't do it. it simply opens the fax form blank with no input value.

Any other ideas?....
 
OK to get rid of the type mismatch problem I got rid of the lookup and simply made the fax company a blank field with imput value. Now I get a syntax error. but I see no problem with statement..

Heres what I have:

stLinkCriteria = "Forms![Fax]![Company]=" & Me!Company
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd

Message I get is: missing operator in query expression.

Please Help this is driving me crazy. I told my boss no problem I can do that in 10 minutes and I have been fooling with this forever.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top