if you do a qry that makes a calculation or alters a field, access can trip up be a pain in the arse. what i've had to do a lot of times is do a qry to make one calculation, save it then do another qry but instead in inserting the original table you insert the query you've just done and make...
What about having it like this?
IF [In Service] = True Then
If [Vehicle Number] = "e1016" Then
Command2.Fore Color = VbBlue
Else
Command2.Fore Color = VbRed
End IF...
Lets have another try then. Try this although it may need slight juggling about just got it spot on.
IF [In Service] = True Then
If [Vehicle Number] = "e1016" Then
Command2.Fore Color = VbBlue
Else
Command2.Fore Color = VbRed
If...
try putting this instead. Hopfully it will work but we may also be back to square 1.
Private Sub Form_Activate()
If [Vehicle Number] = "e1016" And [In Service] = True Then
Command2.ForeColor = vbBlue
Else
Command2.ForeColor = vbRed
End If
If [Vehicle Number] = "f4567" And [In Service] = True...
try cutting this from the code "[Vehicle Number] = "e1016" And " to in effect you will have
"<code>
If [In Service] = True Then
Command2.ForeColor = vbBlue
Else
Command2.ForeColor = vbRed
End If
</code>
"
and if this code can go into the 'form activate' section instead of the 'form open' (if...
can't you just search to see if vehicles are in service instead of specifying a vegicle number. If you specifying vehicle "e1016" then the code will stop searching as soon as it gets that vehicle number. Or have I miss-understood your problem?
Im tring to run a delete query where the records to be deleted from one table match the records in another table. But i keep getting the msg "Could not delete from specified tables". Any idea's how to get round this?????
I need to know if it is possible to to save a link to a word document within an access table so that the user can simply click on the link and the document will open. Help please?! :confused: