update subform

  • Thread starter Thread starter Pete
  • Start date Start date
P

Pete

I have a combo on my main form that I select an address from. How do I get
the subform that shows the address to update instantly. If I move onto the
next record then return, the info is displayed. Can I make this happen as
soon as I have chosen the required address from the combo.

cheers

Pete
 
In the Query that is creating the subform go into design
view. Under the Criteria of Address put in combo box
name. Example if the combo box name is combo1 but
[combo1] in the criteria it will then look at what is in
the address box on the main form and the information will
update automatically on the subform to the address you
want to lok at.

Wes Paul
(e-mail address removed)
 
I have a combo on my main form that I select an address from. How do I get
the subform that shows the address to update instantly. If I move onto the
next record then return, the info is displayed. Can I make this happen as
soon as I have chosen the required address from the combo.

Requery the Subform in the AfterUpdate event of the combo, using the
Requery action in a macro or some simple VBA code:

Private Sub comboboxname_AfterUpdate()
Me!subformname.Requery
End Sub
 
You can also get Access to move records and return to the
origional. In this example I have a txtbox named invoice
number on a form called invoice.

Dim Currentinvoice As Long

Currentinvoice = Me![InvoiceNumber]

Echo 0
DoCmd.GoToRecord acDataForm, "Invoice", acFirst
DoCmd.GoToRecord acDataForm, "Invoice", acLast
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[InvoiceNumber] = " &
Currentinvoice & ""
Me.Bookmark = Me.RecordsetClone.Bookmark
Echo 1

You can keep echo on but the user sees the records jump.
 
Back
Top