"This expression is typed incorrectly" - Huh?

  • Thread starter Thread starter Jocelyn
  • Start date Start date
J

Jocelyn

Please bear with me; it's been awhile since I've used
Access...

I'm trying to create a simple (or so I thought) database
to use for a rather large/bulky mail merge of legal
documents. My database has two tables: PrincipalInfo and
StoreInfo. The PrincipalInfo table has company
information, phone numbers, etc. The StoreInfo table has
information about stores that are owned by Principals. A
record in the StoreInfo table is related to the
PrincipalInfo by the PrincipalID. It's a one-to-many
relationship; a Principal can own more than one store, but
a store can never be owned by more than one Principal. The
idea is to enter a Principal's info once, and then connect
the Principal to the stores they own. I could create a
mail merge data source in Word, but I'm trying to avoid
typing some Principal's info over and over again. Some
Principals own many stores.

Here's the problem - I've created a form named
PrincipalInfo (not original, I know), with a subform
StoreInfo. The idea is to enter all the Principal's
information and then enter the information about their
stores in the subform. But, after I enter a record in the
subform and then close the form, when I try to open the
form again I get the error message "This expression is
typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many
complicated elements. Try simplyfying the expression by
assigning parts of the expression to variables." And the
stubform doesn't appear - it is just a blank box. My
response is "Huh?". I am lost and befuddled.

I've searched the Knowledgebase and have yet to find
anything useful. If anyone knows what I'm doing wrong,
your input would be greatly appreciated. Thank you in
advance -

Jocelyn Bonebrake
jlbonebrakeAT(NOSPAM)kahalacorp.com
 
Jocelyn,
That sounds like an error you would get when you create a complicated
expression in a query. What is the recordsource for your form and subform?
 
The recordsource for the Principal Info form is the table
PrincipalInfo.

When I click on the Store Info subform (it puts a little
black box in the upper left hand corner) and then go to
the Properties Box, under the Data tab it says the Record
Source is SELECT [StoreInfo].[StoreIDNumber], and on and
on listing all the fields in the StoreInfo table.

Now if I click on the the subform without getting the
little black box, the Properties box says the Source
Object is StoreInfo subform.
 
See my replies inline below

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Jocelyn said:
The recordsource for the Principal Info form is the table
PrincipalInfo.

Ok, that shouldn't be causing your error.
When I click on the Store Info subform (it puts a little
black box in the upper left hand corner) and then go to
the Properties Box, under the Data tab it says the Record
Source is SELECT [StoreInfo].[StoreIDNumber], and on and
on listing all the fields in the StoreInfo table.

Did you create this form/subform using a wizard or did you do it by yourself
from scratch? The next thing you will want to check is the Parent and Child
LinkFields. See if there is anything peculiar looking there. So far I don't
see any reason for the error you are getting. Do you have any code behind
the form and/or any of the controls on the form?
Now if I click on the the subform without getting the
little black box, the Properties box says the Source
Object is StoreInfo subform.

That's because, when you don't see the little black box, you are actually
looking at the properties of the subform CONTROL on the main form, not the
properties of the subform itself.
 
See my replies also inline below
-----Original Message-----
See my replies inline below

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
table PrincipalInfo.

I didn't think it was either.
When I click on the Store Info subform (it puts a little
black box in the upper left hand corner) and then go to
the Properties Box, under the Data tab it says the Record
Source is SELECT [StoreInfo].[StoreIDNumber], and on and
on listing all the fields in the StoreInfo table.

Did you create this form/subform using a wizard or did you do it by yourself
from scratch?
Wizard.

The next thing you will want to check is the Parent and
Child LinkFields. See if there is anything peculiar
looking there. So far I don't see any reason for the error
you are getting. Do you have any code behind the form
and/or any of the controls on the form?

Hmmm... The Parent and Child LinkFields are both
PrincipalID. In the PrincipalInfo table the PrincipalID
field is the primary key and it auto-numbered. The primary
key in the StoreInfo table is the StoreNumber field, a
number that I enter. The only code behind a control that I
know of is a button on the Principal info form that adds a
new record. Again, wizard created. Also, I have three
combo boxes on the Principal Info form for indicating what
type of phone number it is (home, cell, etc.), but I'm
pretty sure those are the problem. Could it be that the
subform is using a query to do something (that whole
SELECT string) and it screwing it up somehow? Should the
Record Source be the StoreInfo table instead of that query?
 
Did you create this form/subform using a wizard or did
you do it by yourself

Wizard.

If all else fails, you might try recreating the form using the Wizard again
to see if the same thing happens.
Hmmm... The Parent and Child LinkFields are both
PrincipalID. In the PrincipalInfo table the PrincipalID
field is the primary key and it auto-numbered. The primary
key in the StoreInfo table is the StoreNumber field, a
number that I enter. The only code behind a control that I
know of is a button on the Principal info form that adds a
new record. Again, wizard created. Also, I have three
combo boxes on the Principal Info form for indicating what
type of phone number it is (home, cell, etc.), but I'm
pretty sure those are the problem. Could it be that the
subform is using a query to do something (that whole
SELECT string) and it screwing it up somehow? Should the
Record Source be the StoreInfo table instead of that query?

That all sounds correct except that, as you mention, I usually would have
the table be the source for my subform instead of a query. I think, at this
point, trying to run the wizard again might be your best bet. I can't tell
much else about it without being able to look at the form properties.
 
See just below.
-----Original Message-----

If all else fails, you might try recreating the form using the Wizard again
to see if the same thing happens.

I kinda already did that. I just recreated the database
this morning. It's not large, (just the two tables and one
form) and I wanted to see if it was just some weird thing
or if I could make it happen again. Obviously not just
some wierd thing.
query?

That all sounds correct except that, as you mention, I usually would have
the table be the source for my subform instead of a query. I think, at this
point, trying to run the wizard again might be your best bet. I can't tell
much else about it without being able to look at the form properties.
I tried switching the Record Source from the query to the
StoreInfo table, yet, I'm still getting the same message.
And I tried recreating the subform with the wizard, but
still same error message. I think I'm going to give it up
and try a different method. What that might be, I don't
know yet. Thank you for your help. I really do appreciate
it! :)
 
Back
Top