Sub Forms

YUPAPA

Registered User.
Local time
Today, 08:02
Joined
Sep 28, 2002
Messages
11
HiHi :)

I have a problem when displaying search result on my sub form.

On the main form, I have a button and the code for that is:
Code:
Private Sub client_manager_search_Click()
    Dim SQL As String
    Set db = CurrentDb()
    
    SQL = "SELECT * FROM client_TBL WHERE client_id = 1"
    db.Execute SQL
    
End Sub

I have a sub form which is a datasheet contains all my data of the table client_TBL.

What I want to do is to display all the records which has client_id 1 onto the subform when I click on the button.

Also, I get error 3065 when I click on the button.

Please help me out!! :) Thank you!
 
Select the ID from a combo box on the Main form. Set the Master Link in the subform to the combo box and the Child Link to the ID field in the subform. Selecting an ID in the combo box will show the related records in the subform.

hth,
Jack
 
Thank you!
But where do you set the Master and Child Links? :p
 
HiHi again...

Can you edit the thing for me??
I think the main problem seems to be visual basic...

http://www2.yupapa.com/db1.mdb

The two forms I am talking about is client_manager_FRM and client_manager_sub_FRM (data sheet)

I have textboxes and a button in the client_manager_FRM and I want to display the multiple search result in the sub form client_manager_sub_FRM

I know nothing about Visual Basic... I can't do it! Sorry... :p

... /:)\ THANKS!
 
Here you go. I made some changes in your main form. There is no real code involved, I just named the Combo box client_id and the Master/Child links took care of the rest... I will let you find the Master/Child links as it will be a good learning experience for you.

Good luck!

Jack
 

Attachments

THANK YOU!
I know how to add the links now
subform -> properties -> data!
 
You are welcome and Right On!

Continued success with Access...

Jack
 

Users who are viewing this thread

Back
Top Bottom