Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form not updating(well kind of) 1

Status
Not open for further replies.

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 :-(




 
Doug,

Thanks for the reply.

I tried requery on the Combo62.
I've also tried refresh on active forms.
For some strange reason I have to enter another PROPID,get that address on screen and then enter the PROPID for the new address I have just added.
Only then will the other details show correctly.

Or should I actually use Combo1 ??

David
 
Doug,

First off all apologises for the last line of my original reply.I realised what I asked.
(Oh for editing posts after being sent)

I'm still having trouble.

Which event to I place the requery on.

Although the new PROPID is showing the relevent details on the rest of the form relate to another record until I close the form,open again and enter the new PROPID again.At this stage everything is correct.

Thank you

David
 
Tried adding requery to various events on forms 1 or 2 plus the combo box.
In the end I added another cmd button with requery.That works.

Doug, thanks for your reply and time.


David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top