finding a field value

mike wild

Registered User.
Local time
Today, 08:38
Joined
Feb 16, 2003
Messages
69
I am trying to find the value in field 1 (called "winselect")
and if the value entered in field 2 (called "winselectb") is the same then i want to make the value of field 2 null.

here is what i have

Dim jim As Integer
jim = [winselect].Value
If [winselectb] = jim Then
[winselectb] = ""
DoCmd.GoToControl "winselectb"
End If

and guess what it does not work!

it does not seem to pick up this line
If [winselectb] = jim Then

can anybody help
 
[qoute]Dim jim As Integer
jim = [winselect].Value
If [winselectb] = jim Then
[winselectb] = "" [/qoute]At the verry least that dont seem logical...

jim = integer (number)
then your setting winselectb = "" (string)
Thus comparing a number to a string .... ???

Also there is no need to compare it using the jim variable
If me.winselect = me.winselectb then
... will do the same... but better
Note the missing [] also me. will allow you to check the correctness of your statement as it presents a dropdown box where you can pick and choose...

Further -if i may- [qoute]the value of field 2 null. [/qoute]Your setting it to "", if you want to set it to null set it to null not an empty string. winselectb = Null.

Hope that helps....

Regards
 
Tnak you very much - it works a treat, and your explanations have also sort out my next coding situation.

thanks again.
 

Users who are viewing this thread

Back
Top Bottom