Tabbed Form Problem

scouser

Registered User.
Local time
Today, 11:25
Joined
Nov 25, 2003
Messages
767
I have been trying to link a tabbed form. I want the user to select the Customer Contact Name from the Sub-Form Customer Contact and then when they click the Tab 'Contact Vehicle' only Vehicles related to that specific Contact Name are displayed. Sounds easy but can I get it to work??

Any advice would be appreciated.

Cheers,
Phil.
 

Attachments

Use [frmCustomers].form![CustomerId] as the master link field on your subform. You will need to set a default Customer ID for the Customers form so that when you open the forms you have a Customer Id to reference. Just add a hidden textbox on the Customers form bound to CustomerId and set default to say 1. That should sort it.
 
Still Trying!

Did as suggested and still not getting the desired result. Take a look at the modified DB with your suggestion implemented. When I navigate through the customer records the Vehicles I have entered (frmContactVehicle) for a specific customer are present for all customer records. I want the Vehicles to be specific to an individual Contact Name?

Any advice.
Cheers,
Phil.

PS: If I try to implement the Link Master / Child I get an error 'Can not link an unbound form'
 

Attachments

You have no vehical id's in the customer table so there is no link. The Link Child/Master should be between teh Customer and Vehical forms sorry I didn't read the problem properly. You seem to have done this but dont forget Child link is CustomerId. Unless each co is only going to have 1 Vehical I would suggest a CustomerVehical table to create a many to many relationship between Customer and Vehical.
 
Sorry Scouser,

We had a big database crash yesterday and I couldn't answer any more questions, are you all sorted now?
 
Confused

I modified the Customer table as suggested by adding VehicleID as a foreign key. However................

The vehicles relate to individual Customer Contact Names and not the Customer?

Not working as I would like (OK.....its just not working!! :D)
Phil.
 
Ok do you want to attach the database again

hopefully I will have more time to look at it today.
 
Database as requested

Thanks very much!!

Basically I want the frmCustomerNew to work as follows:

Tab 1: Main Form - Customer
Sub Form - Customer Contacts
(The above works fine, each contact is specific to a single Customer)

Tab 2 (The problem) - When on Tab 1, if the user selects a Customer Contact Name (clicks in the field on the Sub-Form) then selects Tab 2 - Contact Vehicles, only vehicles belonging to the selected customer contact will be displayed!!

Maybe you can think of a better way i.e. no tabs but an additional sub-form?

Many thanks,
Phil.

PS: I added VehicleID to tblCustomer as suggested in this thread. I do not feel that is the way to go with what I am trying to acheive so you may wish to amend the Relationships then delete!!
 

Attachments

Object Variable Error?

It continues to frustrate me! Ha!

I am still plugging away trying to get my main customer form to works as I would like. I have added a tabbed sub form to the main customer form. The tabbed form:
Tab1 = Customer Contact
Tab2 = Contact Vehicles

I have attempted to link Master/Child:
CustomerID frmCustomers - CustomerID frmCustomerContacts

I get an error "Object variable or with block variable not set."

So my question.
How do I get the frmCustomerContacts linked to frmCustomers so when I navigate through the Customer form it shows only the contacts relative to the customer being viewed. With that the ContactVehicle tabbed form should also be relative to the customer contact.

Am I making sense here!!

All will become clear if you view "frmCustomersNew"
Thanks in advance,
Phil.
 

Attachments

Last edited:
Still Trying

Still trying??
It has got to be something obvious that my tiny brain is missing!!
:D
 
variable not set etc etc

Hi Scouser,

I'm having a very similar problem to yours and have just come across this forum, did you manage to resolve the issue of 'object variable or With block variable not set'? It's really beginning to annoy me and would appreciate any help.
 
Gave Up

I gave up on that angle and just added a couple of fields to my main order form!!
:D
 

Users who are viewing this thread

Back
Top Bottom