"Type Mis-match" error on an Option Group

M

Mike Webb

Using Access 2K2; experience level: beginner
============================================

I get a "Type Mis-Match" error when I press any of the option group buttons.
(I am virtually copying the Customer Phone List form and macro from the
Northwinds sample database).
I'm at a loss on what to check. My record source is a single table. I've
looked at everything for something to 'jump out at me', but no
luck. Any ideas on what I should be looking for?
(I am getting the filtered results, as I want, but would like to stop this
error from popping up before I deploy the FE to the users.)

TIA,
Mike Webb
Platte River Whooping Crane Maintenance Trust, Inc.
a non-profit 501(c)(3) organization
 
M

Mike Webb

It appears to be this line:

Condition: [CurrentRecord]>0
Action: GoToControl
Comment: If records are returned for the selected letter, go to the
LastName control.
Control Name: LastName

Tried to duplicate it just now and got just the "Type Mis-match" error;
couldn't "force" it to produce the Action Failed dialog box I have been
getting. The contents of that were:
Macro Name: macroContact_Email_List.Alpha Buttons
Condition: True: [CurrentRecord] > 0
Action Name: GoToControl
Arguments: LastName

Mike
 
M

Mike Webb

An additional, an unrelated, problem has come up .... when I test this form
by pressing the alpha buttons, I wind up with some of the last names
(LastName field) being changed to a 1- or 2-digit number. The first record
is always changed, but the rest are random. No more than 6-7 of the 1899
records are changed. I changed the field on the form to LOCK, hoping that
would stop the changes. Didn't work. I'm at a loss to know why this is
happening?

Any ideas out there,
Mike
 
K

Ken Snell

I'm tied up on some work projects at the moment, and will get back to you
later today....!
 
K

Ken Snell

I'm guessing that you have a problem with the data and/or how you set up the
form. I don't believe that the error is the macro itself.

In the sample database, the macro sends the focus to the CompanyName
control; you obviously have changed that setup to be a control named
LastName?

Describe for us the table and its structure and data that you're using as
the form's recordsource. What are the fields? What are their formats/sizes?
Is the Lookup tab showing something other than Text Box (open the table in
design view, select a field, and click on the Lookup tab at the bottom of
the window)?

Also describe for us how you've changed the form from what is in the sample
database. What controls are on the form? What is the form's recordsource?

Your subsequent post suggests that the LastName control is actually
displaying an "ID" (primary key in the table?). Are you using a lookup field
in the table for the LastName data?


--
Ken Snell
<MS ACCESS MVP>


Mike Webb said:
It appears to be this line:

Condition: [CurrentRecord]>0
Action: GoToControl
Comment: If records are returned for the selected letter, go to the
LastName control.
Control Name: LastName

Tried to duplicate it just now and got just the "Type Mis-match" error;
couldn't "force" it to produce the Action Failed dialog box I have been
getting. The contents of that were:
Macro Name: macroContact_Email_List.Alpha Buttons
Condition: True: [CurrentRecord] > 0
Action Name: GoToControl
Arguments: LastName

Mike
 
M

Mike Webb

Sorry to take so long in replying.

To answer your request for more information ...
In the sample database, the macro sends the focus to the CompanyName
control; you obviously have changed that setup to be a control named
LastName?
Yes, that is correct.
============================
Describe for us the table and its structure and data that you're using as
the form's recordsource. What are the fields? What are their formats/sizes?
Is the Lookup tab showing something other than Text Box (open the table in
design view, select a field, and click on the Lookup tab at the bottom of
the window)?
PK: ID (autonumber)
The rest are Text datatypes left at default of 255: LastName, TitlePrefix,
TitleSuffix, FirstName, MiddleInitialName, NickName, Organization, Address,
City, State, ZipCode, and Email.
All are set to "TextBox".
==============================
Also describe for us how you've changed the form from what is in the sample
database. What controls are on the form? What is the form's recordsource?
What I've changed is that the intent of the form is to display by Email
Address vice the contacts phone number. The buttons in the Option Group
still point to the first letter of the LastName field. The form's record
source is "tblAddressList" and the control sources are: "Organization",
"LastName", "FirstName", and "Email".
The macro was copied 'as-is'; all I changed was reference to the record
source - LastName.
====================================================
Your subsequent post suggests that the LastName control is actually
displaying an "ID" (primary key in the table?). Are you using a lookup field
in the table for the LastName data?
No look up fields.

TIA,
Mike

Ken Snell said:
I'm guessing that you have a problem with the data and/or how you set up the
form. I don't believe that the error is the macro itself.

In the sample database, the macro sends the focus to the CompanyName
control; you obviously have changed that setup to be a control named
LastName?

Describe for us the table and its structure and data that you're using as
the form's recordsource. What are the fields? What are their formats/sizes?
Is the Lookup tab showing something other than Text Box (open the table in
design view, select a field, and click on the Lookup tab at the bottom of
the window)?

Also describe for us how you've changed the form from what is in the sample
database. What controls are on the form? What is the form's recordsource?

Your subsequent post suggests that the LastName control is actually
displaying an "ID" (primary key in the table?). Are you using a lookup field
in the table for the LastName data?


--
Ken Snell
<MS ACCESS MVP>


Mike Webb said:
It appears to be this line:

Condition: [CurrentRecord]>0
Action: GoToControl
Comment: If records are returned for the selected letter, go to the
LastName control.
Control Name: LastName

Tried to duplicate it just now and got just the "Type Mis-match" error;
couldn't "force" it to produce the Action Failed dialog box I have been
getting. The contents of that were:
Macro Name: macroContact_Email_List.Alpha Buttons
Condition: True: [CurrentRecord] > 0
Action Name: GoToControl
Arguments: LastName

Mike

Ken Snell said:
On which macro line are you getting this error? Can you give us a bit more
info?

--
Ken Snell
<MS ACCESS MVP>

Using Access 2K2; experience level: beginner
============================================

I get a "Type Mis-Match" error when I press any of the option group
buttons.
(I am virtually copying the Customer Phone List form and macro from the
Northwinds sample database).
I'm at a loss on what to check. My record source is a single table. I've
looked at everything for something to 'jump out at me', but no
luck. Any ideas on what I should be looking for?
(I am getting the filtered results, as I want, but would like to
stop
this
error from popping up before I deploy the FE to the users.)

TIA,
Mike Webb
Platte River Whooping Crane Maintenance Trust, Inc.
a non-profit 501(c)(3) organization
 
K

Ken Snell

Thanks for the additional info.

My only guess without looking at the database is that there is no control
named LastName on the form. What is the name of the textbox control that is
bound to the field named LastName?

Other than that, if you can zip up the database and email it to me (remove
this is not real from my email address) with simple instructions on how to
duplicate the error, I'll take a look as time permits.
--
Ken Snell
<MS ACCESS MVP>

Mike Webb said:
Sorry to take so long in replying.

To answer your request for more information ...
In the sample database, the macro sends the focus to the CompanyName
control; you obviously have changed that setup to be a control named
LastName?
Yes, that is correct.
============================
Describe for us the table and its structure and data that you're using as
the form's recordsource. What are the fields? What are their formats/sizes?
Is the Lookup tab showing something other than Text Box (open the table in
design view, select a field, and click on the Lookup tab at the bottom of
the window)?
PK: ID (autonumber)
The rest are Text datatypes left at default of 255: LastName, TitlePrefix,
TitleSuffix, FirstName, MiddleInitialName, NickName, Organization, Address,
City, State, ZipCode, and Email.
All are set to "TextBox".
==============================
Also describe for us how you've changed the form from what is in the sample
database. What controls are on the form? What is the form's
recordsource?
What I've changed is that the intent of the form is to display by Email
Address vice the contacts phone number. The buttons in the Option Group
still point to the first letter of the LastName field. The form's record
source is "tblAddressList" and the control sources are: "Organization",
"LastName", "FirstName", and "Email".
The macro was copied 'as-is'; all I changed was reference to the record
source - LastName.
====================================================
Your subsequent post suggests that the LastName control is actually
displaying an "ID" (primary key in the table?). Are you using a lookup field
in the table for the LastName data?
No look up fields.

TIA,
Mike

Ken Snell said:
I'm guessing that you have a problem with the data and/or how you set up the
form. I don't believe that the error is the macro itself.

In the sample database, the macro sends the focus to the CompanyName
control; you obviously have changed that setup to be a control named
LastName?

Describe for us the table and its structure and data that you're using as
the form's recordsource. What are the fields? What are their formats/sizes?
Is the Lookup tab showing something other than Text Box (open the table in
design view, select a field, and click on the Lookup tab at the bottom of
the window)?

Also describe for us how you've changed the form from what is in the sample
database. What controls are on the form? What is the form's recordsource?

Your subsequent post suggests that the LastName control is actually
displaying an "ID" (primary key in the table?). Are you using a lookup field
in the table for the LastName data?


--
Ken Snell
<MS ACCESS MVP>


Mike Webb said:
It appears to be this line:

Condition: [CurrentRecord]>0
Action: GoToControl
Comment: If records are returned for the selected letter, go to the
LastName control.
Control Name: LastName

Tried to duplicate it just now and got just the "Type Mis-match" error;
couldn't "force" it to produce the Action Failed dialog box I have been
getting. The contents of that were:
Macro Name: macroContact_Email_List.Alpha Buttons
Condition: True: [CurrentRecord] > 0
Action Name: GoToControl
Arguments: LastName

Mike

On which macro line are you getting this error? Can you give us a
bit
more
info?

--
Ken Snell
<MS ACCESS MVP>

Using Access 2K2; experience level: beginner
============================================

I get a "Type Mis-Match" error when I press any of the option group
buttons.
(I am virtually copying the Customer Phone List form and macro
from
the
Northwinds sample database).
I'm at a loss on what to check. My record source is a single table.
I've
looked at everything for something to 'jump out at me', but no
luck. Any ideas on what I should be looking for?
(I am getting the filtered results, as I want, but would like to stop
this
error from popping up before I deploy the FE to the users.)

TIA,
Mike Webb
Platte River Whooping Crane Maintenance Trust, Inc.
a non-profit 501(c)(3) organization
 
K

Ken Snell

Mike -

I've looked at your database, and found the problem to both items about
which you'd posted: the "Type mismatch" error, and the "writing of numbers
into last name field".

Both problems result because you have the option group of buttons (the ones
that you use to select the last name filtering) bound to the LastName field
in the form's recordsource. Because of this, the "type mismatch" error
occurs because the form is trying to store a numeric value into the text
LastName field (the data types don't match). In the few times when it has
been able to store the value, it overwrites the LastName's actual last name
value.

Open your form in design view, select the option group, open up the
Properties window, click Data tab, and delete LastName from the control
source for the option group (leave it blank). That should fix both problems.
 
M

Mike Webb

Worked! Thanks for your time and advice!

Mike
Ken Snell said:
Mike -

I've looked at your database, and found the problem to both items about
which you'd posted: the "Type mismatch" error, and the "writing of numbers
into last name field".

Both problems result because you have the option group of buttons (the ones
that you use to select the last name filtering) bound to the LastName field
in the form's recordsource. Because of this, the "type mismatch" error
occurs because the form is trying to store a numeric value into the text
LastName field (the data types don't match). In the few times when it has
been able to store the value, it overwrites the LastName's actual last name
value.

Open your form in design view, select the option group, open up the
Properties window, click Data tab, and delete LastName from the control
source for the option group (leave it blank). That should fix both problems.
 

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