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

Report not drawing info from form unless I click in field

Status
Not open for further replies.

sweetaud

Technical User
Feb 17, 2003
3
SE
I have a form which displays list-box fields based on 2 dropdown/combo boxes. The pool of data that the form works on is from a query involving several tables.

The form seems to work fine - it correctly filters and displays the fields based on the 2 combo-boxes.

However, it seems that while the fields DISPLAY the results, the report which reads the fields does not acknowledge the data displayed UNLESS I actually click on each field on the form. It is not updating the fields I guess. I am no Access expert, so perhaps something is wrong, but I can't see what as it "works" when I click the fields.

For example I have following fields:

>>ListBox on Form:

Row Source Type: Table/Query
Row Source: SELECT [qvrFoljeSedel].[Beställare] FROM [qvrFoljeSedel] WHERE [qvrFoljeSedel].[tblProv_KokID] = [Forms]![frmFoljeSedel]![KokID] AND [qvrFoljeSedel].[tblProv_ProvtagareID] = [Forms]![frmFoljeSedel]![ProvtagareID]


>>TextBox on Report:

Control Source: =IIf([Forms]![frmFoljeSedel]![Bestallare2] Is Not Null;[Forms]![frmFoljeSedel]![Bestallare2];[Forms]![frmFoljeSedel]![Bestallare])

Any help will be GREATLY appreciated ! :)

Thanks Much

Aud.
 
Try this:

Before running the report, save the changes made in the list boxes:

DoCmd.RunCommand accmdSaveRecord

then

DoCmd.OpenReport "YourReport"

Hope this helps! Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Hi again. I tried that, but got the following error:

Run-time error '2046'
The command or or action 'SaveRecord' isn't available now.

For the time being I have written a macro that selects the fields by saving the keystrokes. As of now, it's the only option working for me right now...

Thanks anyway. If you or anyone else has any cleaner solutions I would appreciate it.

Aud.
 
Instead of the save record command,try:

Forms![YourFormName].Refresh

When you click in the fields, you may be causing a refresh to occur.

Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top