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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking for a form event 2

Status
Not open for further replies.

MasterRacker

New member
Oct 13, 1999
3,343
US
I have a form bound to a Products table. On the form I have an unbound lookup combo that uses the following wizard code to select a product
Code:
Private Sub ProductLookup_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[ProductID] = " & Str(Nz(Me![ProductLookup], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

If I create a new product, it does not show in the combo until I "F5" to refresh the form. If I'm using the built-in record navigator controls to create a new record, what's the event I'm looking for to do a requery on the combobox?

Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
I think the After Insert event should do, as it would trigger after a new record is entered.

Or to be sure that also alterations caused by an edit of a record is shown, you could use the After Update event.

After Insert or After Update events of the form, that is.

Roy-Vidar
 
How are ya MasterRacker . . .

Try the forms [blue]AfterUpdate[/blue] event ...

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
I knew I was being braindead. That's the problem with being a generalist. Don't touch something for months then come back to it and you're rusty on the basics. Thanks.

Jeff
[small][purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day
"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top