First try at creating at option group - please help

G

Guest

Hello All.
I have not attempted to use an option group before, so please bare with me.
I have an archive table, which contains 5 different types of archives, which
I want to call up by using an option group on a form. I have created the
option group and am trying to set the conditions for each in the macro. My
syntax looks like this:
Condition : [accounts filter]=1
Action : ApplyFilter
Archive name : Accounts
Where condition : [Archives]![Box Name] Like "[Acc*]

The error message says MS Access cannot parse the expression [Archives]![Box
Name] Like "[Acc*]. Archives is the table name and Box Name is the column in
the table which holds the 5 types of boxes which I want to be able to filter
using the option group on the form.

Can anyone tell me what is wrong please?
Thanks in advance.
 
D

Douglas J Steele

You're missing a closing quote, and, unless your values look like
[AccountName], [AccountNumber] rather tha AccountName, AccountNumber, you
don't need the square brackets.

Try

[Archives]![Box Name] Like "Acc*"
 
G

Guest

Hello

I have renamed the option group to Archive Filters and subsequently changed
the condition column to read:
[Archive Filters]=1
[Archive Filters]=2 etc.
I have changed th Where Condition criteria to this:
[Forms]![Archives]![Box Name] Like "Acc*"

My error reads:
MS Access cant find the name "archive filters" you entered in the expression

Any ideas?

Thanks.
 
G

Guest

I have tried the following:

[Archives]![Box Name] Like "Acc *"

[Forms]![Archives]![Box Name] Like "Acc *"

[Forms]![Archives]![Accounts] Like "Acc *"

[Archives]![Accounts] Like "Acc *"

According to MS Access help file, syntax should be:
Forms!formname!controlname
So I changed the syntax to the last 2 samples as above.
Form name is "Archives" and control name is "accounts" in the accounts
filters option group (named Archive Filters) using a toggle button.

I still get the error saying MS Access cannot find the name "Archive
Filters" used in the expression... Is there anything else you could suggest?

Thanks again.
Douglas J Steele said:
You're missing a closing quote, and, unless your values look like
[AccountName], [AccountNumber] rather tha AccountName, AccountNumber, you
don't need the square brackets.

Try

[Archives]![Box Name] Like "Acc*"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


mix said:
Hello All.
I have not attempted to use an option group before, so please bare with me.
I have an archive table, which contains 5 different types of archives, which
I want to call up by using an option group on a form. I have created the
option group and am trying to set the conditions for each in the macro. My
syntax looks like this:
Condition : [accounts filter]=1
Action : ApplyFilter
Archive name : Accounts
Where condition : [Archives]![Box Name] Like "[Acc*]

The error message says MS Access cannot parse the expression [Archives]![Box
Name] Like "[Acc*]. Archives is the table name and Box Name is the column in
the table which holds the 5 types of boxes which I want to be able to filter
using the option group on the form.

Can anyone tell me what is wrong please?
Thanks in advance.
 
G

Guest

Error message indicates a syntax error as opposed to a reference error. Check
your operand "Acc*" as opposed to "Acc *" perhaps?
--
Jim


mix said:
I have tried the following:

[Archives]![Box Name] Like "Acc *"

[Forms]![Archives]![Box Name] Like "Acc *"

[Forms]![Archives]![Accounts] Like "Acc *"

[Archives]![Accounts] Like "Acc *"

According to MS Access help file, syntax should be:
Forms!formname!controlname
So I changed the syntax to the last 2 samples as above.
Form name is "Archives" and control name is "accounts" in the accounts
filters option group (named Archive Filters) using a toggle button.

I still get the error saying MS Access cannot find the name "Archive
Filters" used in the expression... Is there anything else you could suggest?

Thanks again.
Douglas J Steele said:
You're missing a closing quote, and, unless your values look like
[AccountName], [AccountNumber] rather tha AccountName, AccountNumber, you
don't need the square brackets.

Try

[Archives]![Box Name] Like "Acc*"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


mix said:
Hello All.
I have not attempted to use an option group before, so please bare with me.
I have an archive table, which contains 5 different types of archives, which
I want to call up by using an option group on a form. I have created the
option group and am trying to set the conditions for each in the macro. My
syntax looks like this:
Condition : [accounts filter]=1
Action : ApplyFilter
Archive name : Accounts
Where condition : [Archives]![Box Name] Like "[Acc*]

The error message says MS Access cannot parse the expression [Archives]![Box
Name] Like "[Acc*]. Archives is the table name and Box Name is the column in
the table which holds the 5 types of boxes which I want to be able to filter
using the option group on the form.

Can anyone tell me what is wrong please?
Thanks in advance.
 
G

Guest

Jim

Thanks for suggestion, but that's not it. Does the column name need to be
shown somewhere? I see the help file only talks about referencing the from
name and the control name.....

JimS said:
Error message indicates a syntax error as opposed to a reference error. Check
your operand "Acc*" as opposed to "Acc *" perhaps?
--
Jim


mix said:
I have tried the following:

[Archives]![Box Name] Like "Acc *"

[Forms]![Archives]![Box Name] Like "Acc *"

[Forms]![Archives]![Accounts] Like "Acc *"

[Archives]![Accounts] Like "Acc *"

According to MS Access help file, syntax should be:
Forms!formname!controlname
So I changed the syntax to the last 2 samples as above.
Form name is "Archives" and control name is "accounts" in the accounts
filters option group (named Archive Filters) using a toggle button.

I still get the error saying MS Access cannot find the name "Archive
Filters" used in the expression... Is there anything else you could suggest?

Thanks again.
Douglas J Steele said:
You're missing a closing quote, and, unless your values look like
[AccountName], [AccountNumber] rather tha AccountName, AccountNumber, you
don't need the square brackets.

Try

[Archives]![Box Name] Like "Acc*"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hello All.
I have not attempted to use an option group before, so please bare with
me.
I have an archive table, which contains 5 different types of archives,
which
I want to call up by using an option group on a form. I have created the
option group and am trying to set the conditions for each in the macro. My
syntax looks like this:
Condition : [accounts filter]=1
Action : ApplyFilter
Archive name : Accounts
Where condition : [Archives]![Box Name] Like "[Acc*]

The error message says MS Access cannot parse the expression
[Archives]![Box
Name] Like "[Acc*]. Archives is the table name and Box Name is the column
in
the table which holds the 5 types of boxes which I want to be able to
filter
using the option group on the form.

Can anyone tell me what is wrong please?
Thanks in advance.
 

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