473,472 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Have a different subforms load depending on cell in a record of theparent form

Rob
I am putting together a small Access 2003 DB to record details of our
motorvehicles. (this is more to teach myself some basics with Access)

The main form is holding data that is common to most vehicles. Eg.
Registration date, expiry, VIN/Chassis, Make, Model, Year.

Additional things that I will record is maintenance/servicing, insurance
etc etc.

The vehicles are a bit varied,: Cars, truck, trailer, motorbikes, caravan.

For these there are different servicing scheduels and I would like to
include them individually.

I have tabs for registration, servicing, insurance, Wheels&tyres etc.

Because of the differences in servicing, I have created 4 subforms for that.

Now I would like to find a way that will load the correct subform when I
load each record in the main form. I had thought that I could make a
col. called ServiceType with a dropdown with options 1, 2, 3 and 4 and
somehow have the correct subform reference this column then load.

Any thoughts on how to go about something like this.
With Thanks
Rob
Sep 30 '08 #1
3 2059
"Rob" <dy@woodyallan.bizwrote in message
news:cB*****************@news-server.bigpond.net.au...
>I am putting together a small Access 2003 DB to record details of our
motorvehicles. (this is more to teach myself some basics with Access)

The main form is holding data that is common to most vehicles. Eg.
Registration date, expiry, VIN/Chassis, Make, Model, Year.

Additional things that I will record is maintenance/servicing, insurance
etc etc.

The vehicles are a bit varied,: Cars, truck, trailer, motorbikes, caravan.

For these there are different servicing scheduels and I would like to
include them individually.

I have tabs for registration, servicing, insurance, Wheels&tyres etc.

Because of the differences in servicing, I have created 4 subforms for
that.

Now I would like to find a way that will load the correct subform when I
load each record in the main form. I had thought that I could make a col.
called ServiceType with a dropdown with options 1, 2, 3 and 4 and somehow
have the correct subform reference this column then load.

Any thoughts on how to go about something like this.
I would have thought that some code in your form's Current event would do
this, something along the lines of:

If Me.txtVehicleType = "Car" Then
Me.MySubformObjectName.SourceObject = "sfrmCar"
ElseIf ...

.... and so on. You'd probably have to set the LinkMasterFields and
LinkChildFields properties too.

Regards,
Keith.
www.keithwilby.com

Sep 30 '08 #2
Keith Wilby wrote:
"Rob" <dy@woodyallan.bizwrote in message
news:cB*****************@news-server.bigpond.net.au...
>I am putting together a small Access 2003 DB to record details of our
motorvehicles. (this is more to teach myself some basics with Access)

The main form is holding data that is common to most vehicles. Eg.
Registration date, expiry, VIN/Chassis, Make, Model, Year.

Additional things that I will record is maintenance/servicing,
insurance etc etc.

The vehicles are a bit varied,: Cars, truck, trailer, motorbikes,
caravan.

For these there are different servicing scheduels and I would like to
include them individually.

I have tabs for registration, servicing, insurance, Wheels&tyres etc.

Because of the differences in servicing, I have created 4 subforms for
that.

Now I would like to find a way that will load the correct subform when
I load each record in the main form. I had thought that I could make
a col. called ServiceType with a dropdown with options 1, 2, 3 and 4
and somehow have the correct subform reference this column then load.

Any thoughts on how to go about something like this.

I would have thought that some code in your form's Current event would
do this, something along the lines of:

If Me.txtVehicleType = "Car" Then
Me.MySubformObjectName.SourceObject = "sfrmCar"
ElseIf ...

... and so on. You'd probably have to set the LinkMasterFields and
LinkChildFields properties too.

Regards,
Keith.
www.keithwilby.com
It might be easier for the op to have a command button called Servicing
Schedule and based on the type of vehicle open a separate form depending
on the type.
Sep 30 '08 #3
"Salad" <oi*@vinegar.comwrote in message
news:A7******************************@earthlink.co m...
Keith Wilby wrote:
>"Rob" <dy@woodyallan.bizwrote in message
news:cB*****************@news-server.bigpond.net.au...
>>>
Any thoughts on how to go about something like this.

I would have thought that some code in your form's Current event would do
this, something along the lines of:

If Me.txtVehicleType = "Car" Then
Me.MySubformObjectName.SourceObject = "sfrmCar"
ElseIf ...

... and so on. You'd probably have to set the LinkMasterFields and
LinkChildFields properties too.

Regards,
Keith.
www.keithwilby.com

It might be easier for the op to have a command button called Servicing
Schedule and based on the type of vehicle open a separate form depending
on the type.
I agree it's a bit fiddly to get it working but is quite slick when it is.

Sep 30 '08 #4

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

Similar topics

2
by: Andante.in.Blue | last post by:
Hello, I have just inherited a very undocumented legacy database, developed in and still running on Access 97. The file is an MDB file, with no security. It is placed in a shared directory on a...
1
by: amywolfie | last post by:
Whenever a record is modified on frmMain, I want the Event(AfterUpdate) to ADD a new record to frmRevisionHistory and goto this form. I also need to Set the FK_ID field of frmRevisionHistory to...
3
by: Diana Gard | last post by:
Perhaps this is a design flaw, please let me know. I'm using Access 2000. I have a form with a tab control and 5 subforms within those tabs. The forms match with the tables: Client main,...
9
by: Zeeshan Iqbal via AccessMonster.com | last post by:
hi, im trying to design a form with two subforms. subforms no.1 (orders) is connected to the main form by customer ID and i dont know how i can connect another subform (order details)to the first...
8
by: Zlatko Matić | last post by:
Hello. How can I synchronize subforms content with current record in master form, if both form and subform are based on DAO code ? I assigned DAO recordset to forms by using QueryDef, on Load...
4
by: Dale Walker | last post by:
I've got a form that currently has a list box used to "find a record on my form" but the list in it is far too long and consists of fields of repeating data. Is there a way of creating a subform...
2
by: Paul | last post by:
I've searched this site for a few hours without a solution to my problem. Please help~ In short, the controls on my form have vanished. I can see nothing but a gray screen and grayed out navigator...
3
by: tlyczko | last post by:
I have a main form with 2 subforms, each subform references different data in the same table. How do I make sure each subform only creates NEW records in the referenced table and do not...
0
by: sparks | last post by:
I was using this to swap out a form with subforms on it by just making a copy and tying each to copy of the same table. subformV1 tblVisit1 subformV2 tblVisit2 etc Select Case TabCtl0.Value...
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
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.