trying to link a button on a form

pam0566

Registered User.
Local time
Today, 04:50
Joined
Jun 6, 2008
Messages
132
I have a form that has information about a vehicle.[formvehicles] I also have a form and subform for a list of makes [form - frmmakes] and their corresponding models [subform- frmmakemodelsubform]. i am trying to but a button on my formvehicles that will pull up the subform, matching the Make Fields. when i use the wizard, there are no fields listed at all on my vehicleinfoform side. the make side shows make id and make.. so that part is fine. i have never seen this happen before wiht buttons...any ideas? I am enclosing a copy of my data base.
 

Attachments

Try this,

I have changed the requery on your model combo cox so it shows the models when you change the make, and put you a button on to open the subform.

I presume you use macros as this is the way the database created the button, if not you need to change the settings and create an event procedure.

Good luck

Sue
 

Attachments

Thanks! This part works great.. I select a vehicle/or enter a vehicle. I select make, then model. if the model isnt listed in teh cbomodel box, i can select the cmd button ADD MODEL, and get the data sheet to add a new model corresponding to the make i entered. Question [and sorry i dont want to be a pain] how can i then close that box and have my cbomodel drop down box show the models includin the one i just added? tried various requery commands in diff spots but cant get that to work right. Also, and this is really minor.. on my new model table where i can add a model, is there any way to have the make field already in there.. so i dont have to type it or can hide it? since the models are based on teh makes anyway? ... thanks so much for all your help!!
 
Hi,

You get the combo box to requery by putting the requery instruction in the on enter event.

To get the make to be prefilled in on the makemodel form you call the form using openargs.

You then test for openargs when the form opens, and if they are there you use them to populate the field.

I have changed the field on the makemodel form to be a combo cox, otherwise the id number of the make shows, rather than the name. This also stops people typing in a make wrongly, if there is a mis-spelling it will never appear in the model drop down.

I have converted the open form of the button from a macro to an event procedure as I am much more familar with them, and they give greater control over what you can do.

I am attaching an updated version of the database again to make more sense.

Sue
 

Attachments

ok.. i had figured a way around it.. but this is much cleaner and easier. thanks so much.. the me.make I think is where i was stuck, and while i was ok with living with make id.. the make name is much cleaner and neater.! thanks so much... i really appreciate it!
 

Users who are viewing this thread

Back
Top Bottom