Macro won't work in a form depositing info into another table

G

Guest

I'm a complete amateur at this, yet bravely soldier on...

I have a main form for inputing general information about a given space (for
architectural programming purposes). I also have forms to input specific
technical information (such as plumbing systems info). These forms input
info to other specific purpose tables. All of the tables are then tied
together in a relationship based on the "Room Name" field.

On the main form, I have a command button which filters the forms (using a
macro) to show only the records for spaces that are "Laboratory spaces".
This works fine. I have copied this command button to the plumbing form.
But when I try to use the button on the plumbing form, I get the dreaded
"Enter Parameter Value" message box. I think it's all about the syntax,
which I don't always understand the fine points of.

Here is the WHERE statement used in the macro LabsOnly that is the event
triggered by the command button on the main form (based on tbl_general_data):
[tbl_general_data]![Super-Category]="Laboratory Space" And
[tbl_general_data]![Number of Spaces - Design]<>0

The plumbing form is based on tbl_piped_lab_services_data. I'm not sure if
Access thinks this is a subform or not.

I've tried adding "Tables!" in front of tbl_general_data - didn't work.
This has got to be a simple thing, but it continues to elude me. Help!
 
G

Guest

Try this --
[tbl_general_data].[Super-Category]="Laboratory Space" And
[tbl_general_data].[Number of Spaces - Design]<>0

Use a period instead of an exclamination mark.
 
G

Guest

--
Walter

Thanks for replying with a syntax change suggestions.

It made no difference for the main form (macro worked fine), but I still got
the "Enter Parameter Value" message when using it on the other form.

Walter
 
G

Guest

How are you using it "on the other form"? What is the exact message?

--
KARL DEWEY
Build a little - Test a little


Walter Broner said:
--
Walter

Thanks for replying with a syntax change suggestions.

It made no difference for the main form (macro worked fine), but I still got
the "Enter Parameter Value" message when using it on the other form.

Walter
KARL DEWEY said:
Try this --
[tbl_general_data].[Super-Category]="Laboratory Space" And
[tbl_general_data].[Number of Spaces - Design]<>0

Use a period instead of an exclamination mark.
 
G

Guest

Exact message is:

Enter parameter value message box expecting value for:
[tbl_general_data].[Super-Category]

Same for the other condition.
--
Walter


KARL DEWEY said:
How are you using it "on the other form"? What is the exact message?

--
KARL DEWEY
Build a little - Test a little


Walter Broner said:
--
Walter

Thanks for replying with a syntax change suggestions.

It made no difference for the main form (macro worked fine), but I still got
the "Enter Parameter Value" message when using it on the other form.

Walter
KARL DEWEY said:
Try this --
[tbl_general_data].[Super-Category]="Laboratory Space" And
[tbl_general_data].[Number of Spaces - Design]<>0

Use a period instead of an exclamination mark.
 
G

Guest

Is the field name typed exactly as in the table? I see you have spaces on
both sides of the dash in [tbl_general_data].[Number of Spaces - Design]
but no spaces in [tbl_general_data].[Super-Category]

This could be the problem.
--
KARL DEWEY
Build a little - Test a little


Walter Broner said:
Exact message is:

Enter parameter value message box expecting value for:
[tbl_general_data].[Super-Category]

Same for the other condition.
--
Walter


KARL DEWEY said:
How are you using it "on the other form"? What is the exact message?

--
KARL DEWEY
Build a little - Test a little


Walter Broner said:
--
Walter

Thanks for replying with a syntax change suggestions.

It made no difference for the main form (macro worked fine), but I still got
the "Enter Parameter Value" message when using it on the other form.

Walter
:

Try this --
[tbl_general_data].[Super-Category]="Laboratory Space" And
[tbl_general_data].[Number of Spaces - Design]<>0

Use a period instead of an exclamination mark.
 
G

Guest

Karl:

Names are OK. Still, the macro works just fine in a form that is the record
source, but not in a form which has another form as its record source. Still
stumped.

Walter


KARL DEWEY said:
Is the field name typed exactly as in the table? I see you have spaces on
both sides of the dash in [tbl_general_data].[Number of Spaces - Design]
but no spaces in [tbl_general_data].[Super-Category]

This could be the problem.
--
KARL DEWEY
Build a little - Test a little


Walter Broner said:
Exact message is:

Enter parameter value message box expecting value for:
[tbl_general_data].[Super-Category]

Same for the other condition.
--
Walter


KARL DEWEY said:
How are you using it "on the other form"? What is the exact message?

--
KARL DEWEY
Build a little - Test a little


:


--
Walter

Thanks for replying with a syntax change suggestions.

It made no difference for the main form (macro worked fine), but I still got
the "Enter Parameter Value" message when using it on the other form.

Walter
:

Try this --
[tbl_general_data].[Super-Category]="Laboratory Space" And
[tbl_general_data].[Number of Spaces - Design]<>0

Use a period instead of an exclamination mark.
 
G

Guest

How do you have a form as record source for a form?
What is your hierarchy from table - query - form - macro?

Your orignal post said ----- On the main form, I have a command button which
filters the forms (using a macro) to show only the records for spaces that
are "Laboratory spaces".
How are you using a macro to filter?

--
KARL DEWEY
Build a little - Test a little


Walter Broner said:
Karl:

Names are OK. Still, the macro works just fine in a form that is the record
source, but not in a form which has another form as its record source. Still
stumped.

Walter


KARL DEWEY said:
Is the field name typed exactly as in the table? I see you have spaces on
both sides of the dash in [tbl_general_data].[Number of Spaces - Design]
but no spaces in [tbl_general_data].[Super-Category]

This could be the problem.
--
KARL DEWEY
Build a little - Test a little


Walter Broner said:
Exact message is:

Enter parameter value message box expecting value for:
[tbl_general_data].[Super-Category]

Same for the other condition.
--
Walter


:

How are you using it "on the other form"? What is the exact message?

--
KARL DEWEY
Build a little - Test a little


:


--
Walter

Thanks for replying with a syntax change suggestions.

It made no difference for the main form (macro worked fine), but I still got
the "Enter Parameter Value" message when using it on the other form.

Walter
:

Try this --
[tbl_general_data].[Super-Category]="Laboratory Space" And
[tbl_general_data].[Number of Spaces - Design]<>0

Use a period instead of an exclamination mark.
 
G

Guest

In all cases tables serve as record sources for the forms. Forms serve to
dump data into tables. I use queries only to generate data sources for
reports. It's not sophisticated, but works for me.

macros only work to limit records to a particular type, as explained in
previous posts.

The issue is I think simple, and has to do with how to reference what I
guess would be called a "foreign" table in a form whose record source is
another table.
 
G

Guest

macros only work to limit records to a particular type
Orignal post --triggered by the command button on the main form (based on tbl_general_data):
[tbl_general_data]![Super-Category]="Laboratory Space" And
[tbl_general_data]![Number of Spaces - Design]<>0

Explain to me how you limit records in a macro?
 

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