D
DJJ
I am accessing individual records in an Physical Inventory Form by selecting
the record from a drop down list in a Search Form. It works well until I
select a record that has no current inventory on hand and then my Physical
Inventory Form displays blank. When this happens I would like to direct the
user to yet another form called Add Inventory. How do I do that?
I tried to put some code in the Form Current Event in the Physical Inventory
Form that checks the current record and then give the user an option to be
redirected but I'm sure I got it all wrong.
Private Sub Form_Current()
Dim Msg, Style, Title, Response
Msg = "Do you want to add this Item Number to the inventory?"
Style = vbYesNo
Title = "Item Not Found"
Dim lngrecordnum As Long
lngrecordnum = Me.Form.CurrentRecord
If lngrecordnum = Null Then
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
DoCmd.OpenForm "frmAddInventory", acNormal, , ,
acFormAdd
Else
DoCmd.Close acForm, "frmPhysInventory"
Exit Sub
End If
End If
End Sub
the record from a drop down list in a Search Form. It works well until I
select a record that has no current inventory on hand and then my Physical
Inventory Form displays blank. When this happens I would like to direct the
user to yet another form called Add Inventory. How do I do that?
I tried to put some code in the Form Current Event in the Physical Inventory
Form that checks the current record and then give the user an option to be
redirected but I'm sure I got it all wrong.
Private Sub Form_Current()
Dim Msg, Style, Title, Response
Msg = "Do you want to add this Item Number to the inventory?"
Style = vbYesNo
Title = "Item Not Found"
Dim lngrecordnum As Long
lngrecordnum = Me.Form.CurrentRecord
If lngrecordnum = Null Then
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
DoCmd.OpenForm "frmAddInventory", acNormal, , ,
acFormAdd
Else
DoCmd.Close acForm, "frmPhysInventory"
Exit Sub
End If
End If
End Sub