473,287 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Data Entry Error in Subform ("Isn't Valid For This Field")

I am using Access 2002 and have two tables (Main and Actions) linked
(in Relationships) on one field "CAL_ID" (primary key in Main Table).
Main Table is a list of equipment. Actions Table lists actions
performed on these pieces of equipment (calibration, cleaning, etc.) so
there are many records per every one record in the Main Table.

I have a form based on Main Table, containing a subform for Actions
Table. This is used for data entry: to add new pieces of equipment,
and new actions. The subform is linked master and child on the CAL_ID
field present in both tables.

Here is my problem: Whenever I go over to the subform and start
entering data in any field (date, combo box, memo field, etc.) I get
the message "The value you entered isn't valid for this field." As
soon as I hit the OK button, it allows me to enter data as normal. I
do NOT get this error when the subform is not linked master and child,
however then I don't get the corresponding Action records as I cycle
through the Main Table records. I also get the error if I have the
subform on Datasheet View. Does anyone know what is wrong? I don't
know if it matters, but the combo box has a Value List, and the Date
field had a Short Date format assigned (because I get this error
regardless of the field, I wouldn't think this affects it).

Liana

Nov 13 '05 #1
5 5388
What is the RecordSource of this subform?

If it is a query, and the query contains more than one table, then this
sounds like a known problem. If you are adding records to table B, and table
A has a field with a Default Value set, Access wrongly attempts to assign
the value to the field from table A. Naturally, this doesn't work, and the
result is the cryptic message that the value cannot be assigned. Removing
the Default Value from the field in the other table solves the problem.

Please post back again if this does not describe the situation you are
seeing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<lo********@hotmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I am using Access 2002 and have two tables (Main and Actions) linked
(in Relationships) on one field "CAL_ID" (primary key in Main Table).
Main Table is a list of equipment. Actions Table lists actions
performed on these pieces of equipment (calibration, cleaning, etc.) so
there are many records per every one record in the Main Table.

I have a form based on Main Table, containing a subform for Actions
Table. This is used for data entry: to add new pieces of equipment,
and new actions. The subform is linked master and child on the CAL_ID
field present in both tables.

Here is my problem: Whenever I go over to the subform and start
entering data in any field (date, combo box, memo field, etc.) I get
the message "The value you entered isn't valid for this field." As
soon as I hit the OK button, it allows me to enter data as normal. I
do NOT get this error when the subform is not linked master and child,
however then I don't get the corresponding Action records as I cycle
through the Main Table records. I also get the error if I have the
subform on Datasheet View. Does anyone know what is wrong? I don't
know if it matters, but the combo box has a Value List, and the Date
field had a Short Date format assigned (because I get this error
regardless of the field, I wouldn't think this affects it).

Liana

Nov 13 '05 #2
Thanks for replying. The source isn't a query. It's a regular table.

Nov 13 '05 #3
In that case, it is most likely that the Format property of a text box on
the form or a field in the table is set incorrectly, or else the data being
entered is not appropriate for the type of field (e.g. a date or number
where you entered a string.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
<lo********@hotmail.com> wrote in message
news:11********************@g49g2000cwa.googlegrou ps.com...
Thanks for replying. The source isn't a query. It's a regular table.

Nov 13 '05 #4
What I think is strange is that I get the error after hitting just one
keystroke. For example, the date is set to Short Date format in both
the table and the subform, but as soon as I hit a zero "0" (or any
other number), I get the error message. Likewise in the "Initials"
field, which is a straight up text box (on the form) and text field (in
the table) - as soon as I hit any character, I get the error.

Also strange is that once I clear the error message once, it accepts
all data just fine with no more errors. Is there a way to supress the
error message so it just doesn't pop up?

Nov 13 '05 #5
If it is just the first keystoke when you begin to add a new record, then
the most likely culprits are either the Default Value of a control or field,
or code in the BeforeInsert event of the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<lo********@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
What I think is strange is that I get the error after hitting just one
keystroke. For example, the date is set to Short Date format in both
the table and the subform, but as soon as I hit a zero "0" (or any
other number), I get the error message. Likewise in the "Initials"
field, which is a straight up text box (on the form) and text field (in
the table) - as soon as I hit any character, I get the error.

Also strange is that once I clear the error message once, it accepts
all data just fine with no more errors. Is there a way to supress the
error message so it just doesn't pop up?

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: edworboys | last post by:
I have a form (Prospect) with a subform (Document). The result I am looking for is this: The user selects a prospect which is made up of Prospect Name, Country, Company and Prospect Type. They...
6
by: Wayne | last post by:
I am designing a database which needs approximately 50 fields per record. The database user requires data entry to be via a single screen. If I follow good database design practice and split the...
10
by: Chris LaJoie | last post by:
Our company has been developing a program in C# for some time now, and we haven't had any problems with it, but just last night something cropped up that has me, and everyone else, stumped. I...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
4
by: LFM | last post by:
I have a form that includes a subform for data entry. The subform is setup to view only one record at a time. I need to limit that subform to only allow the user to enter one record at a time,...
3
by: bosmatthews | last post by:
I have a main form with a subform and a second subform nested to the first subform. The data entry property for all three forms (main, subform and sub-subform) is set to "yes" because I am intending...
6
by: LeeAnne | last post by:
Hello! I have a problem with my fk's behind the main form. Here is the situation: Table PERSONS is behind the main form and table BANK_DETAILS is behind the subform on a different tab. There...
3
Jerry Maiapu
by: Jerry Maiapu | last post by:
Can please someone help me out. I am a beginner (of VB) I have a main form with a sub form created based on two tables having one to many relationships. i want to prompt the users a message...
2
by: Emily Lisker | last post by:
I am using Yes/No/Null number combo boxes per Allen Browne's instructions (http://allenbrowne.com/NoYesNo.html). My validation rule is: "Is Null Or 0 Or -1" I copied Allen Browne's lookup box...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.