Look up

R

Ruth

Hi

I am trying to create a form to lookup all the entries made for a chosen
client

I have a downdown box that contains a customer code. I want the customer
code to be a parent to a subform. I have managed to do this in the past by
having the code copy over into another cell (sorry don't know what to call
it). and having the child look to that cell, as it didn't work otherwise. I
am trying the same method again and can't get the customer code choosen to go
to the other cell.



Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerCode] = " & Str(Nz(Me![Combo4], 1))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


Private Sub Form_BeforeUpdate(Cancel As Integer)

End Sub

End Sub

What code should I use- or is there a better way to set it up?
 
R

Ruth

What should I do?

--
Thank-you!
Ruth


Dennis said:
Well, you cannot nest SUBs for one thing.

Ruth said:
Hi

I am trying to create a form to lookup all the entries made for a chosen
client

I have a downdown box that contains a customer code. I want the customer
code to be a parent to a subform. I have managed to do this in the past by
having the code copy over into another cell (sorry don't know what to call
it). and having the child look to that cell, as it didn't work otherwise. I
am trying the same method again and can't get the customer code choosen to go
to the other cell.



Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerCode] = " & Str(Nz(Me![Combo4], 1))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


Private Sub Form_BeforeUpdate(Cancel As Integer)

End Sub

End Sub

What code should I use- or is there a better way to set it up?
 
R

Ruth

Hi again Dennis

I figured it out, thank-you!


--
Thank-you!
Ruth


Dennis said:
Well, you cannot nest SUBs for one thing.

Ruth said:
Hi

I am trying to create a form to lookup all the entries made for a chosen
client

I have a downdown box that contains a customer code. I want the customer
code to be a parent to a subform. I have managed to do this in the past by
having the code copy over into another cell (sorry don't know what to call
it). and having the child look to that cell, as it didn't work otherwise. I
am trying the same method again and can't get the customer code choosen to go
to the other cell.



Private Sub Combo4_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[CustomerCode] = " & Str(Nz(Me![Combo4], 1))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark


Private Sub Form_BeforeUpdate(Cancel As Integer)

End Sub

End Sub

What code should I use- or is there a better way to set it up?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top