WingandaPrayer
Technical User
- May 15, 2001
- 152
Here I go,
I use a combo box to locate an address. When the address is there the focus is set on a certain field within the form
Privare Sub Combo62_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PROPID] = '" & Me![Combo62] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
Me![HEATING TYPE].SetFocus
Me.HEATING_TYPE.Dropdown
End Sub
If the address isn't there the example below happens.
Private Sub Combo62_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_PROPID_notinlist
If MsgBox("Address is not in list. Would you like to Add the Address?", vbOKCancel) = vbOK Then
DoCmd.OpenForm "frmENTERNEWADDRESSDETAILS", , , , acFormAdd, acDialog
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
Exit_PROPID_notinlist:
Exit Sub
Err_PROPID_notinlist:
MsgBox Err.Description
Resume Exit_PROPID_notinlist
End Sub
The details are entered onto frmENTERNEWADDRESSDETAILS
Once the last field has data entered, the form closes(using macro) with a message stating another table has been updated and returns to the original field in the form where the address is entered.
The problem.
I re-type the address in the combo box , it appears but it will not focus to the next part of the form.
I have a button on the form to try the next address which normally works but not after I have added a new address.
Question.
Do I have to requery somewhere or do something else ??
I think I have mentioned everything.
Thank you
David :-(
I use a combo box to locate an address. When the address is there the focus is set on a certain field within the form
Privare Sub Combo62_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PROPID] = '" & Me![Combo62] & "'"
Me.Bookmark = Me.RecordsetClone.Bookmark
Me![HEATING TYPE].SetFocus
Me.HEATING_TYPE.Dropdown
End Sub
If the address isn't there the example below happens.
Private Sub Combo62_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_PROPID_notinlist
If MsgBox("Address is not in list. Would you like to Add the Address?", vbOKCancel) = vbOK Then
DoCmd.OpenForm "frmENTERNEWADDRESSDETAILS", , , , acFormAdd, acDialog
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
Exit_PROPID_notinlist:
Exit Sub
Err_PROPID_notinlist:
MsgBox Err.Description
Resume Exit_PROPID_notinlist
End Sub
The details are entered onto frmENTERNEWADDRESSDETAILS
Once the last field has data entered, the form closes(using macro) with a message stating another table has been updated and returns to the original field in the form where the address is entered.
The problem.
I re-type the address in the combo box , it appears but it will not focus to the next part of the form.
I have a button on the form to try the next address which normally works but not after I have added a new address.
Question.
Do I have to requery somewhere or do something else ??
I think I have mentioned everything.
Thank you
David :-(