G
gymphil
I am using a second form to enter new data, when I return back to the main
form I can only auto fill the productID detail, all the other data entered in
the 'newpart' form is not visible on the main form, Don't know how and where
to refresh the form data, can anyone assist? thankyou
Phil
Private Sub Combo14_AfterUpdate()
Set rs = Me.Recordset.Clone
rs.FindFirst "[productID] = '" & Me![Combo14] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo14_NotInList(NewData As String, Response As Integer)
Dim Result
Dim Msg As String
Dim CR As String: CR = Chr$(13)
If NewData = "" Then Exit Sub
Msg = "'" & NewData & "' is not in the list." & CR & CR
Msg = Msg & "Do you want to add it?"
If MsgBox(Msg, 32 + 4) = 6 Then
DoCmd.OpenForm "newpart", , , , acAdd, acDialog, NewData
End If
Result = DLookup("[productID]", "products", _
"[productID]=""" & NewData & """")
If IsNull(Result) Then
Response = DATA_ERRCONTINUE
MsgBox "Please try again!"
Else
Response = DATA_ERRADDED
End If
End Sub
form I can only auto fill the productID detail, all the other data entered in
the 'newpart' form is not visible on the main form, Don't know how and where
to refresh the form data, can anyone assist? thankyou
Phil
Private Sub Combo14_AfterUpdate()
Set rs = Me.Recordset.Clone
rs.FindFirst "[productID] = '" & Me![Combo14] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo14_NotInList(NewData As String, Response As Integer)
Dim Result
Dim Msg As String
Dim CR As String: CR = Chr$(13)
If NewData = "" Then Exit Sub
Msg = "'" & NewData & "' is not in the list." & CR & CR
Msg = Msg & "Do you want to add it?"
If MsgBox(Msg, 32 + 4) = 6 Then
DoCmd.OpenForm "newpart", , , , acAdd, acDialog, NewData
End If
Result = DLookup("[productID]", "products", _
"[productID]=""" & NewData & """")
If IsNull(Result) Then
Response = DATA_ERRCONTINUE
MsgBox "Please try again!"
Else
Response = DATA_ERRADDED
End If
End Sub