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

2 prblemsm, should be simple to solve both regarding record source

Status
Not open for further replies.

OC2

IS-IT--Management
Apr 2, 2001
59
SG
Hi,

First problem,

Im doing a contact database which uses two tables,
First table is clientA and the second table clientB.
Each client needs it own table as the data required is different for each of them.

When I add a new contact, I want to use only one contact update form which can add the contact to the relevent table.

Heres how I want to do it. I want to use a combo box. The values ClientA and ClientB will be the options to choose from. If I click on ClientA it will change the record source to ClientA, if I click Client B it will change the record source to Client B.

Any idea on how to do that?

Second Problem.

How do I view a report based on a forms filtered record source? i.e. I have a search feature on my form, after I have done the search I want the info illustrated on a Report.

Any ideas how I do that?
When I tried it says the report needs to be open to update its record soure, and when the report is open it says already printing report (its not though)

Any help will be greatly appreiciated.

Thx Regards


Tom

 
sorry for the unacceptble spelling on the title
 
Hi!

First problem:
Private Sub cboRecordSourceChange_AfterUpdate()
Me.RecordSource = IIf(IsNull(Me.cboRecordSourceChange), "", Me.cboRecordSourceChange)
End Sub

Second Problem.
Yes, you can use the search results on a Report.
Example:
Private Sub Report_Open(Cancel As Integer)
Me.RecordSource = Forms("MySearchForm").RecordSource
'Also you can set many others form's and object properties on your Report
End Sub

Regards!
Aivars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top