link pull down/drop down menu to query access

G

Guest

I have a main page, with 5 command buttons on it. Each button opens up a
different form. And the way i set it up before, each "FW" field for the
queries the form came from, had a criteria: "Enter Fiscal Week". That works,
but it gets annoying after a while because the user has to keep reentering a
FW.

So i created a drop down/pull down menu on the main pg, that has all the
fiscal weeks. And i'm trying to link the command button to the combo button
so that it will look at the chosen FW that the user selects from the combo
box, and the command button will open accordingly.

The thing is, the "FW" field in my queries come from one table, therefore i
keep getting the error message:

"The specified field "fw" could refer to more than one table listed in the
FROM clause of your SQL statement"


Other than recreating the queries (so i have one instead of 5), is there any
other way i can get this to work?

Thanks!!!
 
G

Guest

One way to do this would be to create a static function to hold the Fiscal
Week number. Then use that function in your query.

Static Function GetFiscalWeek(Optional ByVal varNewFW As Variant) As Integer
Dim varFiscalWeek As Variant

If Not IsMissing(varNewFW) Then
varFiscalWeek = varNewFW
End If
GetFiscalWeek = varFiscalWeek
End Function
 
G

Guest

ooo...too complicated!!! i'm a basic access user who relies on wizard!!! is
there a way to do it WITHOUT getting into coding?
 
G

Guest

You expect a certified Psycopath to speak normal English???? :)

Okay, one alternative is to use 5 different queries. Another would be to
add a control to your form for the user to enter that number. Let's call it
txtFiscalWeek.
Now, in your query, put this in the Criteria row of the field that stores
the fiscal week.
[forms]![YourFormNameGoesHere]![txtFiscalWeek]


First,
 
G

Guest

Not to sound like a pain, but what kind of control should i add to the main
form where the user will enter the fiscal week? (ie. command,
combo,list,text,etc)

Klatuu said:
You expect a certified Psycopath to speak normal English???? :)

Okay, one alternative is to use 5 different queries. Another would be to
add a control to your form for the user to enter that number. Let's call it
txtFiscalWeek.
Now, in your query, put this in the Criteria row of the field that stores
the fiscal week.
[forms]![YourFormNameGoesHere]![txtFiscalWeek]


First,

lay said:
or at least explain it in "normal" english, please? thanks so much!!
 
G

Guest

ok, i tried it....added a "text box" to the main pg, named it MainPgFW...then
opened one of my query tables and in the FW criteria, i filled it with

[forms]![Data Integrity]![MainPgFW]

SO now when i try and open that qry, up pops up a box that prompts me to
enter something...but that doesn't happen to the form, and it's not
referencing the text box in the main page at all....HELP!!!

i'm going to pull all of my hair out very soon!!!

(thanks for your help though!!)
Klatuu said:
You expect a certified Psycopath to speak normal English???? :)

Okay, one alternative is to use 5 different queries. Another would be to
add a control to your form for the user to enter that number. Let's call it
txtFiscalWeek.
Now, in your query, put this in the Criteria row of the field that stores
the fiscal week.
[forms]![YourFormNameGoesHere]![txtFiscalWeek]


First,

lay said:
or at least explain it in "normal" english, please? thanks so much!!
 
G

Guest

I don't see the problem. Since I don't use tabbed pages much, I am not sure
of the syntax, but I will be willing to be it has to do with identifying the
tab on the form in the query criteria.

lay said:
ok, i tried it....added a "text box" to the main pg, named it MainPgFW...then
opened one of my query tables and in the FW criteria, i filled it with

[forms]![Data Integrity]![MainPgFW]

SO now when i try and open that qry, up pops up a box that prompts me to
enter something...but that doesn't happen to the form, and it's not
referencing the text box in the main page at all....HELP!!!

i'm going to pull all of my hair out very soon!!!

(thanks for your help though!!)
Klatuu said:
You expect a certified Psycopath to speak normal English???? :)

Okay, one alternative is to use 5 different queries. Another would be to
add a control to your form for the user to enter that number. Let's call it
txtFiscalWeek.
Now, in your query, put this in the Criteria row of the field that stores
the fiscal week.
[forms]![YourFormNameGoesHere]![txtFiscalWeek]


First,

lay said:
or at least explain it in "normal" english, please? thanks so much!!

:

One way to do this would be to create a static function to hold the Fiscal
Week number. Then use that function in your query.

Static Function GetFiscalWeek(Optional ByVal varNewFW As Variant) As Integer
Dim varFiscalWeek As Variant

If Not IsMissing(varNewFW) Then
varFiscalWeek = varNewFW
End If
GetFiscalWeek = varFiscalWeek
End Function


:

I have a main page, with 5 command buttons on it. Each button opens up a
different form. And the way i set it up before, each "FW" field for the
queries the form came from, had a criteria: "Enter Fiscal Week". That works,
but it gets annoying after a while because the user has to keep reentering a
FW.

So i created a drop down/pull down menu on the main pg, that has all the
fiscal weeks. And i'm trying to link the command button to the combo button
so that it will look at the chosen FW that the user selects from the combo
box, and the command button will open accordingly.

The thing is, the "FW" field in my queries come from one table, therefore i
keep getting the error message:

"The specified field "fw" could refer to more than one table listed in the
FROM clause of your SQL statement"


Other than recreating the queries (so i have one instead of 5), is there any
other way i can get this to work?

Thanks!!!
 
G

Guest

ok, i tried it again, and i this time, i got it right! silly me put "data
integrity" as the form name, but it should really have been "mainPG" since
the user is inputting the value in the MainPG.

Thanks so much!!!!

Klatuu said:
I don't see the problem. Since I don't use tabbed pages much, I am not sure
of the syntax, but I will be willing to be it has to do with identifying the
tab on the form in the query criteria.

lay said:
ok, i tried it....added a "text box" to the main pg, named it MainPgFW...then
opened one of my query tables and in the FW criteria, i filled it with

[forms]![Data Integrity]![MainPgFW]

SO now when i try and open that qry, up pops up a box that prompts me to
enter something...but that doesn't happen to the form, and it's not
referencing the text box in the main page at all....HELP!!!

i'm going to pull all of my hair out very soon!!!

(thanks for your help though!!)
Klatuu said:
You expect a certified Psycopath to speak normal English???? :)

Okay, one alternative is to use 5 different queries. Another would be to
add a control to your form for the user to enter that number. Let's call it
txtFiscalWeek.
Now, in your query, put this in the Criteria row of the field that stores
the fiscal week.
[forms]![YourFormNameGoesHere]![txtFiscalWeek]


First,

:

or at least explain it in "normal" english, please? thanks so much!!

:

One way to do this would be to create a static function to hold the Fiscal
Week number. Then use that function in your query.

Static Function GetFiscalWeek(Optional ByVal varNewFW As Variant) As Integer
Dim varFiscalWeek As Variant

If Not IsMissing(varNewFW) Then
varFiscalWeek = varNewFW
End If
GetFiscalWeek = varFiscalWeek
End Function


:

I have a main page, with 5 command buttons on it. Each button opens up a
different form. And the way i set it up before, each "FW" field for the
queries the form came from, had a criteria: "Enter Fiscal Week". That works,
but it gets annoying after a while because the user has to keep reentering a
FW.

So i created a drop down/pull down menu on the main pg, that has all the
fiscal weeks. And i'm trying to link the command button to the combo button
so that it will look at the chosen FW that the user selects from the combo
box, and the command button will open accordingly.

The thing is, the "FW" field in my queries come from one table, therefore i
keep getting the error message:

"The specified field "fw" could refer to more than one table listed in the
FROM clause of your SQL statement"


Other than recreating the queries (so i have one instead of 5), is there any
other way i can get this to work?

Thanks!!!
 

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