Sam Summers
Registered User.
- Local time
- Today, 15:42
- Joined
- Sep 17, 2001
- Messages
- 939
Hi there,
I must be missing a small point here.
I am simply trying to ensure that users can not enter no data and that after entering an item that i check to see if they require an EN Number before the item is saved.
At the moment it is not quite working. I seem to be able to make it save the item but not without checking if they require an EN Number first.
Here is the code:
Dim Msg, Style, Title, Response
Me.EquipDescription.SetFocus
If Me.EquipDescription.Text = "" Or IsNull(EquipDescription) Then
DoCmd.Beep
MsgBox "Please enter an Item", vbOKOnly + vbExclamation, "No Data entered"
End
End If
Me.ENNumber.SetFocus
If Me.ENNumber.Text = "" Or IsNull(ENNumber) Then
Msg = "Does this item have an EN Number?"
Style = vbYesNo + vbQuestion
Title = "EquiTrac"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
Me.ENNumber.SetFocus
'End
Else
End If
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, "AddAccessfrm", acSaveYes
DoCmd.OpenForm "AddAccessfrm", acNormal
End If
Thanks in advance
I must be missing a small point here.
I am simply trying to ensure that users can not enter no data and that after entering an item that i check to see if they require an EN Number before the item is saved.
At the moment it is not quite working. I seem to be able to make it save the item but not without checking if they require an EN Number first.
Here is the code:
Dim Msg, Style, Title, Response
Me.EquipDescription.SetFocus
If Me.EquipDescription.Text = "" Or IsNull(EquipDescription) Then
DoCmd.Beep
MsgBox "Please enter an Item", vbOKOnly + vbExclamation, "No Data entered"
End
End If
Me.ENNumber.SetFocus
If Me.ENNumber.Text = "" Or IsNull(ENNumber) Then
Msg = "Does this item have an EN Number?"
Style = vbYesNo + vbQuestion
Title = "EquiTrac"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
Me.ENNumber.SetFocus
'End
Else
End If
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close acForm, "AddAccessfrm", acSaveYes
DoCmd.OpenForm "AddAccessfrm", acNormal
End If
Thanks in advance