D
DavidW
I have got something I cannot get around.
I have used the if IsNull and the If Nz expression to stop a code from
executing if a textbox is empty.
Every expression I hvae entered I get the following error
"You have entered an expression that has no value!"
Below is a sample of my code that is in the "on current" event.
Any help is greatly appreciated
'checks for empy Textbox
If Nz([Forms]![onroaduse].Text33, "") = "" Then
[Forms]![onroaduse].on2!Text58.Visible = False
[Forms]![onroaduse].on2!Text60.Visible = False
'ends sub if textbox is empty
Exit Sub
End If
'find a duplicated record
If [Forms]![onroaduse].Text33 = [Forms]!onroaduse].Unit Then
DoCmd.Close acForm, ("reminder")
DoCmd.OpenForm ("verror")
End If
End Sub
[Forms]![onroaduse].Text33 has the default value from a second subform(2nd
subform is linked by unit/vehicle, and by date to the main form) that
references a query to search for existing records. The first subform is for
data entry only.
I have used the if IsNull and the If Nz expression to stop a code from
executing if a textbox is empty.
Every expression I hvae entered I get the following error
"You have entered an expression that has no value!"
Below is a sample of my code that is in the "on current" event.
Any help is greatly appreciated
'checks for empy Textbox
If Nz([Forms]![onroaduse].Text33, "") = "" Then
[Forms]![onroaduse].on2!Text58.Visible = False
[Forms]![onroaduse].on2!Text60.Visible = False
'ends sub if textbox is empty
Exit Sub
End If
'find a duplicated record
If [Forms]![onroaduse].Text33 = [Forms]!onroaduse].Unit Then
DoCmd.Close acForm, ("reminder")
DoCmd.OpenForm ("verror")
End If
End Sub
[Forms]![onroaduse].Text33 has the default value from a second subform(2nd
subform is linked by unit/vehicle, and by date to the main form) that
references a query to search for existing records. The first subform is for
data entry only.