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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type MisMatch in Tab Code

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
Good afternoon, folks, I have I small problem that I just can't quite figure the last bit out on. I have a form and the pkey is ECNNumber, when I tab from one page to another page the ECNNumber has been changing, so to stop this tried to put a procedure in the OnExit event of the last textbox on the page. Here is the code:
If Me.TypeNumber = 100 And "ECNNumber = " & Me.ECNNumber Then
When I tab out of that textbox I get Error 13: Type Mismatch. Can anyone spot my error? Thank you in advance to anyone helping out.
 
I think you have to change the line to
If Me.TypeNumber = 100 And "ECNNumber = " & Me!ECNNumber Then
or add .value at the of Me.ECNNumber (Notice the bang ! above)
 
I don't understand what the second part of the statement is trying to evaluate. The expression

if "ECNNumber = " & me.ECNNumber

will always evaluate to true. what is the TypeNumber variable dimensioned as?
 
Thank you for much for the responses.
Philly44: I trie the change and it still changed ECNNumbers rather than pages. I am not really sure I understand the .value you mentioned.
jimbOne: That is something I used it DCount check in another procedure to only check one ECNNumber, so I used it as a starting point, I am totally open to any suggestions that would keep this on the same ECNNumber from page to page.
Thank you all again for the responses.
 
I just discovered a post about cycling, guess what that cured my problem also. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top