OK...Im new...need some help.... (1 Viewer)

etterjt

New member
Local time
Today, 06:49
Joined
Nov 25, 2002
Messages
6
OK, I have database setup and everything is working except this last detail. On my switch board I want to be able to select a field and then a report to pop-up according to which "account" i select from the combo-box. Right now i can't get past getting the combo-box to select anything....won't let me "select" and heck getting the report to pop up...I have no clue.... Please help.... :)

Jack
 

Jack Cowley

Registered User.
Local time
Today, 06:49
Joined
Aug 7, 2000
Messages
2,639
Are you saying that you cannot make a selection from the combo box? Is the form the combo box and 'account' field on have its Allow Edits property set to No?

Once you get the combo box to work just put code like this in its After Update event:

DoCmd.OpenReport "ReportName", , ,"[AccountID] = " & Me.ComboBoxName

The above code assumes that AccountID is a number... Change the names above to correspond to the actual names of your report, account and combo box.

hth,
Jack
 

etterjt

New member
Local time
Today, 06:49
Joined
Nov 25, 2002
Messages
6
OK....

Alright..THANK YOU!!!..I got the form to accept data...my box now selects and it also pulls up the record. My question now is how do I get it so it only prints that record and not the entire data base? Also, how do i get the combo box to update when I add new accounts?

jack
 

Jack Cowley

Registered User.
Local time
Today, 06:49
Joined
Aug 7, 2000
Messages
2,639
Add a command button to print your report using the Wizard. When the button is complete open it and change the code to read:

DoCmd.OpenReport "ReportNameHere", acViewNormal , , "[AccountID] = " & Me.AccountID

If the Row Source of your Combo box is a Table or Query then adding new data to the table will show in the Combo box. If you are using a Value List as the Row Source Type then change it to Table/Query and change the Row Source to a table or query.

hth,
Jack
 

sambo

Registered User.
Local time
Yesterday, 22:49
Joined
Aug 29, 2002
Messages
289
If you want the combo box to be repopulated on the fly, then put this line in the GotFocus event of the combo box.

Me.cboBoxName.Requery

This will get the freshest recordset everytime you select the combo box.
 

Users who are viewing this thread

Top Bottom