473,387 Members | 1,455 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,387 software developers and data experts.

Form / subform

I am trying to develop a mileage log for a set of company vehicles. I have created two tables in my testing and set the relationships. I want to have a subform on my mileage log showing the car and a photo of the car.

I have created a test frmMileage form with the subform from the tblCarInfo. I can not get the subform out of datasheet view. I have gone to the properties of the main form and selected single form with no success.

Any thoughts?

Steve
Nov 20 '08 #1
5 1599
missinglinq
3,532 Expert 2GB
To change the view of the subform, you need to open the form it is based on, in Design View, and change it there in the Properties Sheet.

But I have to say that it sounds as if you've got the horse before the cart here! A form/subform is usually a One to Many relationship. The normal way of doing this would be to have the car's identification info, photo, etc on the main form (the One side) with the mileage being shown in the subform (the Many side.)

Linq ;0)>
Nov 20 '08 #2
OK good advise. I found this out when I started with the test form. It is now working like I want the relationship to be working.

I still can not get the subform to reconize anything but datasheet.

Thanks for the help.
Nov 20 '08 #3
OK that worked. Thanks so much. The form is looking good. The next question is this; I want to have the code prefill the starting mileage in the mileage subform from the ending mileage of the previous input. I have tried a query and with no luck.

Steve
Nov 21 '08 #4
Ok it is late and I finally have had a chance to get back to this small project.

I have created two tables tblMileage and tblCarInfo. The corresponding field in each table is called CarNumber. I have created the key on tblCarInfo field CarNumber. I have then created relationship between the two tables one two many between the car number from the mileage to the car info.

I created a test form and it placed the table info from both tblCarInfo and tblMileage on the form. I entered the first car it allows me edit the mileage for that car on that form in the datasheet Subform. I want to enter a new car and when I get ready to enter the mileage I get an error stating "The changes you requested to the table were not successful because they would create duplicate values in the index, primary key or relations ship. Change the data in the fields that contain duplicate data, remove the index, or redefine the index to receives duplicate entries." Like I said I know its late but I can not figure this out.

Also when I switch from car to car I would like the other fields to prefill on the form. Still have not figured that out.

Thanks
Nov 28 '08 #5
It was late and I had the key on the wrong table.

The child table shows up on the form but in datasheet. Is there a way to change that to single form?
Nov 28 '08 #6

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

Similar topics

9
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text field called . It gets populated based on what the user selects in a field on the...
2
by: Claude | last post by:
Let' say we have an application for a production facility running 24/7 broken into 3 shifts 6-2,2-10,10-6 each production report date contains 3 shifts as above in each shift there can be from...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
14
by: Anja | last post by:
Hi everyone, I have a sub form that references a query to get the results. However, what I want to do is filter the results further based on a certain criteria. How can I tell the sub form to...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
6
NeoPa
by: NeoPa | last post by:
Introduction The first thing to understand about Sub-Forms is that, to add a form onto another form takes a special Subform control. This Subform control acts as a container for the form that you...
11
by: mrowe | last post by:
I am using Access 2003. (I am also using ADO in the vast majority of my code. I recently read a post that indicated that ADO is not all that is was initially cracked up to be. In the back of my...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.