Open a Query related form with a comm button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to open a form or datasheet with a command button with data from a
query but showing only certain information.

Let me explain, I've got a database for all my clients and a table with all
their detail, and they need to go to certain meetings (table for meetings and
detail concerning the meetings, venue etc).

On my form with the Clients details I have a subform where the meeting
details are capured, I now want to know how I can get a datasheet to show me
all the clients attending one or more meetings, ideally, if a client is to
attend meeting no1 I want to see how many other are attending this specific
meeting. I've got a query set up to show me the attendance for each meeting
but I cant get it to work from the form.

When i go the next client who want to attend meetinh no2 etc for example,
then I want to get that info with a click of the command button.

I hope its clear

Any help would be dearly appreciated

ajk
 
Have the query showing each meeting and who is attending as the Record
Source for the form. When you open the form via the command button, send a
filter for the meeting field in the command line that opens the form.

Example:
DoCmd.OpenForm "frmMyForm",,,"[ClassNumberField]=" &
Me.txtClassNumber,,acDialog

The acDialog at the end will open the form as a Dialog form. This will mean
that you'll have to close it again before continuing. If you don't want
that, delete everything after Me.txtClassNumber.
 
Wayne,

Thanks for your reply, but i get an error saying it can't find the object, I
created a new from from my query as you suggested but it keeps giving me the
same error, might be something I've done,

Maybe you know what's wrong

Wayne Morgan said:
Have the query showing each meeting and who is attending as the Record
Source for the form. When you open the form via the command button, send a
filter for the meeting field in the command line that opens the form.

Example:
DoCmd.OpenForm "frmMyForm",,,"[ClassNumberField]=" &
Me.txtClassNumber,,acDialog

The acDialog at the end will open the form as a Dialog form. This will mean
that you'll have to close it again before continuing. If you don't want
that, delete everything after Me.txtClassNumber.

--
Wayne Morgan
MS Access MVP


ajk said:
I want to open a form or datasheet with a command button with data from a
query but showing only certain information.

Let me explain, I've got a database for all my clients and a table with
all
their detail, and they need to go to certain meetings (table for meetings
and
detail concerning the meetings, venue etc).

On my form with the Clients details I have a subform where the meeting
details are capured, I now want to know how I can get a datasheet to show
me
all the clients attending one or more meetings, ideally, if a client is to
attend meeting no1 I want to see how many other are attending this
specific
meeting. I've got a query set up to show me the attendance for each
meeting
but I cant get it to work from the form.

When i go the next client who want to attend meetinh no2 etc for example,
then I want to get that info with a click of the command button.

I hope its clear

Any help would be dearly appreciated

ajk
 
Did you adjust the names to match the names you're using? Did you adjust the
listing to one line? The newsreader frequently wraps lines.

--
Wayne Morgan
MS Access MVP


ajk said:
Wayne,

Thanks for your reply, but i get an error saying it can't find the object,
I
created a new from from my query as you suggested but it keeps giving me
the
same error, might be something I've done,

Maybe you know what's wrong

Wayne Morgan said:
Have the query showing each meeting and who is attending as the Record
Source for the form. When you open the form via the command button, send
a
filter for the meeting field in the command line that opens the form.

Example:
DoCmd.OpenForm "frmMyForm",,,"[ClassNumberField]=" &
Me.txtClassNumber,,acDialog

The acDialog at the end will open the form as a Dialog form. This will
mean
that you'll have to close it again before continuing. If you don't want
that, delete everything after Me.txtClassNumber.

--
Wayne Morgan
MS Access MVP


ajk said:
I want to open a form or datasheet with a command button with data from
a
query but showing only certain information.

Let me explain, I've got a database for all my clients and a table with
all
their detail, and they need to go to certain meetings (table for
meetings
and
detail concerning the meetings, venue etc).

On my form with the Clients details I have a subform where the meeting
details are capured, I now want to know how I can get a datasheet to
show
me
all the clients attending one or more meetings, ideally, if a client is
to
attend meeting no1 I want to see how many other are attending this
specific
meeting. I've got a query set up to show me the attendance for each
meeting
but I cant get it to work from the form.

When i go the next client who want to attend meetinh no2 etc for
example,
then I want to get that info with a click of the command button.

I hope its clear

Any help would be dearly appreciated

ajk
 

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

Back
Top