473,407 Members | 2,312 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,407 software developers and data experts.

The Value you Entered for this Field isn't Valid Error

43
Hi All,

I have been wroking on the databse for a while now and am on the stage of creating forms. I am trying to create a subform at the moment but am having some problems.

I am using the wizard to create the form and add the necessary fields as below:

The tables are as follows:

tblTourBookings
(Main Table linked to others)
Tour ID (Primary Key)
Client ID
(lots of other fields that are unimportant and unlinked)

tblTourDetails (this is kind of the equvalent of a shopping list and is the subform)
TourID (Composite Primary Key)
CostID (Composite Primary Key)
DayPrice

tblToursOffered (this is like the inventory of products - but in this case it is tours)
CostID (Primary Key)
TourName
Itinerary
DayPrice

There is a client table linked to ClientID and Credit card table linked to that in a one to one relationship.

I Create a form with the following tables in it:
TourID
ClientID
CostID
TourName
DayPrice

The latter three go into a subform but when I choose from a combo box for CostID (which currently only displays the autonumber as generated in tblToursOffered). The problem is that when I select a number i get an error message:

"The Value you Entered for this Field isn't Valid Error
For Example, you may have entered text in a numeric field or a number that is larger than the FieldSize setting permits."

It will not allow me to enter any value without displaying the error message.

Any advice or help would be much appreciated and the databse can be sent via e-mail is needed.

Many thanks in advance

Edd
Mar 24 '07 #1
9 4600
MMcCarthy
14,534 Expert Mod 8TB
Hi Edd

Your main form would be based on tblTourBookings. DayPrice should not be in both the tblTourDetails and tblToursOffered tables. Your subform would be based on a query based on tblTourDetails and tblToursOffered something like the following.

Expand|Select|Wrap|Line Numbers
  1. SELECT TourID, tblToursOffered.CostID, TourName, Itinerary, DayPrice
  2. FROM tblTourDetails.CostID = tblToursOffered.CostID
Your subform would be tied to the main form based on TourID.

Mary
Mar 25 '07 #2
xian2
43
Dear Mary,

Many thanks for your kind response.

I tried it out with the following query:

Expand|Select|Wrap|Line Numbers
  1. SELECT [tblTourDetails].[TourID], [tblToursOffered].[CostID], [tblToursOffered].[TourName], [tblToursOffered].[DayPrice] FROM ([tblToursOffered] INNER JOIN [tblTourDetails] ON [tblToursOffered].[CostID] =[tblTourDetails].[CostID])
But there is still a problem with the subform. I can not select anything from any of the fields in the subform.

The CostID just displays (Autonumber) and does not display a list to select from and will not let me enter anything. It is enabled and not locked.

The TourName field is blank but does not provide a dropdown menu and will not let me enter any text.

The CostID just dings at me when i try to enter anything and the TourName field comes up with the following message:
Cannot add record(s); join key of table 'tblTourDetails not in recordset.

If you could offer some help or advice I would be very grateful.

Thanks in advance

Best wishes

Edd
Mar 25 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Hi Edd

I think your problem lies with your table structures and relationships.

Firstly open the relationships window and click on the relationships between the three tables. They should have the Referential Integrity and Cascading update checkboxes ticked.

Mary
Mar 25 '07 #4
xian2
43
Hi Mary,

Once again many thanks for your help.

However, I am still having trouble, I have linked the tables together enforcing referential integrity and cascade update but still hit problems with no dropdown menu and an error if I try to enter anything.

I have scanned through my properties but could it be something wrong with them?

Many thanks again for all your help

Edd
Mar 25 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
Hi Mary,

Once again many thanks for your help.

However, I am still having trouble, I have linked the tables together enforcing referential integrity and cascade update but still hit problems with no dropdown menu and an error if I try to enter anything.

I have scanned through my properties but could it be something wrong with them?

Many thanks again for all your help

Edd
Edd

The problem isn't with your table it's with your query.

Run this query
Expand|Select|Wrap|Line Numbers
  1. SELECT [tblTourDetails].[TourID], [tblToursOffered].[CostID],
  2. [tblToursOffered].[TourName], [tblToursOffered].[DayPrice] 
  3. FROM ([tblToursOffered] INNER JOIN [tblTourDetails] 
  4. ON [tblToursOffered].[CostID] =[tblTourDetails].[CostID])
And you will see you have the same problem.

Check the records in both tables. If there are any records in one table that don't have corresponding records in the other table then you will have a problem.
Mar 26 '07 #6
xian2
43
Hi Mary,

Once gain thank you for replying.

I did try that other query an you are right, once again it didn't work.

I have checked the tables and there are no entries so there are none that do not correspond.

I am really stuck with this now so any advice is very much appreciated.

Best wishes

Edd
Mar 26 '07 #7
MMcCarthy
14,534 Expert Mod 8TB
tblTourDetails (this is kind of the equvalent of a shopping list and is the subform)
TourID (Composite Primary Key)
CostID (Composite Primary Key)

tblToursOffered (this is like the inventory of products - but in this case it is tours)
CostID (Primary Key)
TourName
Itinerary
DayPrice

Hi Edd

The above being the structure of your tables (with no other fields). Go to tblTourDetails and in the composite primary keys make them lookup fields to the other tables primary keys.

Make sure both have indexed property set to Yes (duplicates OK)
Mar 26 '07 #8
xian2
43
Dear Mary,

Thank you so much for your help, it worked perfectly.

I changed the fields to lookup and they worked exactly as desired in the form.

I hope this helps anyone who is stuck with a similar problem and if it is the same problem give me a shout and I will do my best to advise.

Thanks again and best wishes

Edd
Mar 27 '07 #9
MMcCarthy
14,534 Expert Mod 8TB
Dear Mary,

Thank you so much for your help, it worked perfectly.

I changed the fields to lookup and they worked exactly as desired in the form.

I hope this helps anyone who is stuck with a similar problem and if it is the same problem give me a shout and I will do my best to advise.

Thanks again and best wishes

Edd
You're welcome Edd.

Glad you got it working.

Mary
Mar 27 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: TekWiz | last post by:
I've got a system that automatically generates a form. I have it set up so that the backend will return to the inital form page with an error object in sessions data (assuming the backend detected...
6
by: WindAndWaves | last post by:
Hi Folks I have inhereted a script that I understand reasonably well, I just do not understand !/^\d+$/.test(el.value) what the hell does that mean? Below is the script (there are really...
12
by: Susan Cranford | last post by:
Please forgive, I have looked at so much info I can't figure out how to put it together even though I know it must be fairly simple. I have an array of input text boxes (txtDOBn) where n is...
3
by: ILCSP | last post by:
Heello, I'm using Access 2000. I have a form with a combo box that has a query as its row source and it's bound to column 1. This combo box is unbound to a record like the rest of the form...
7
by: BobRoyAce | last post by:
Let's say I have a text box on a page in which a user is to enter a monetary amount and that I want to ensure that the user enters a value greater than or equal to a certain value that will be...
13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
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...
1
by: kang jia | last post by:
hi currently i am editing signup page, when user enter deupicated NRIC and click signup, they will go to do_signuppage and read the error message and then after 5 seconds, they will be redirected...
1
beacon
by: beacon | last post by:
Hi everybody, I have an Employee table with the following: Table - Employee -------------------------- ID: AutoNum, PK FName: Text LName: Text Status: Yes/No
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.