Upon opening form - QryMustContain@Least1DestinationField.. no que

B

bUncE

Afternoon,

I have a form where the user selects a drop down value which determines the
record source of the form (opens in design mode, changes source)

Then it runs

DoCmd.OpenForm "frmMain", "qryFilterST"

It worked perfectly until earlier when i now get this error message

"Query must contain at least one destination field.. "

The queries open fine by themselves and select the right data, there are no
other queries in the mix with this form, just tables..

Does anyone have any idea what to do? I have tried importing into a new db.
I have other users dbs which i tried copying then updating all the
links/queries etc appropriately, still no luck..

Any help greatly appreciated..

Thanks
 
F

fredg

Afternoon,

I have a form where the user selects a drop down value which determines the
record source of the form (opens in design mode, changes source)

Then it runs

DoCmd.OpenForm "frmMain", "qryFilterST"

It worked perfectly until earlier when i now get this error message

"Query must contain at least one destination field.. "

The queries open fine by themselves and select the right data, there are no
other queries in the mix with this form, just tables..

Does anyone have any idea what to do? I have tried importing into a new db.
I have other users dbs which i tried copying then updating all the
links/queries etc appropriately, still no luck..

Any help greatly appreciated..

Thanks

It may be just a typo in this message, but your OpenForm code is
missing a comma.
DoCmd.OpenForm "frmMain", "qryFilterST"
shoud be
DoCmd.OpenForm "frmMain", , "qryFilterST"
if you are setting the Filter argument of the OpenForm method.
Note: the Filter argument is very seldom used. It might be simpler to
have one query or table as the form's record source and use the Where
clause argument to filter the records.
Look up the OpenForm method in VBA help.
 

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