S
SAC
I'm using an estimating form with a combo box for inventory.
I want to open the inventory form if there's not an inventory item in the
combo box of the estimating form, enter the inventory info, close the form
and continue with the estimating form.
Since I have entered the description in the combo box of the estimating form
I would like this to be automatically entered in the description control on
the inventory form. And I'd like the control for Category to have
ELECTRICAL already in it when the form opens.
Also, how do I pause the below code until the inventory form is closed?
Do I use the Open_Args some way?
Private Sub txtInvenKey_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
Dim intAnswer As Integer
Dim dbs As DAO.Database, rst As DAO.Recordset
Dim strOldValue As String
Dim strName As String
Dim varCost As Variant
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblInventory", dbOpenDynaset) 'Open the
recordset for the combobox table
intAnswer = MsgBox("Add " & NewData & " to Inventory?", vbQuestion +
vbYesNo) 'Caption of ComboBox
If intAnswer = vbYes Then
'********** Opens inventory form **************
DoCmd.OpenForm "frmInventory", acNormal
Response = acDataErrAdded ' Requery the combo box list.
Exit Sub
Else
Me.Undo
Response = acDataErrContinue ' Require the user to select
' an existing item
End If
End Sub
THANKS!
I want to open the inventory form if there's not an inventory item in the
combo box of the estimating form, enter the inventory info, close the form
and continue with the estimating form.
Since I have entered the description in the combo box of the estimating form
I would like this to be automatically entered in the description control on
the inventory form. And I'd like the control for Category to have
ELECTRICAL already in it when the form opens.
Also, how do I pause the below code until the inventory form is closed?
Do I use the Open_Args some way?
Private Sub txtInvenKey_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
Dim intAnswer As Integer
Dim dbs As DAO.Database, rst As DAO.Recordset
Dim strOldValue As String
Dim strName As String
Dim varCost As Variant
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblInventory", dbOpenDynaset) 'Open the
recordset for the combobox table
intAnswer = MsgBox("Add " & NewData & " to Inventory?", vbQuestion +
vbYesNo) 'Caption of ComboBox
If intAnswer = vbYes Then
'********** Opens inventory form **************
DoCmd.OpenForm "frmInventory", acNormal
Response = acDataErrAdded ' Requery the combo box list.
Exit Sub
Else
Me.Undo
Response = acDataErrContinue ' Require the user to select
' an existing item
End If
End Sub
THANKS!