Still need help pre-populating a new form

C

Craig Armitage

Hi Wayne,

Thanks for your reply. Unfortunately I think its the wrong way round. If i
read your code correctly, it opens an existing appointment with matching
criteria..

What I need is a way to get from the Customers form into a new appointment
form with just the customers ID pre-populated.

So lets say I have a Customer record for Mrs Jones... currently I can go to
a new appointment form and select her name from a drop-down and fill in the
rest. But it would be so much nicer if I could click on a "Make
Appointment" button in the customer form that opens the Appointments form
and creates a new record with her customerID pre-populated.

The main reason for me wanting to do this is that the customers table
currently has 3000+ records!
 
G

Guest

I though that what I had given.

If you have set the relationship between customers and appointments then you
just need to use the code I gave and it will open the appointments form with
some (what ever you have included) already populated.

If you really want to you can add the close option for the main form - but -
you may be better off just having the appointments form as a popup (set
mondal to yes) and maximise on open.

If you still have problems post back
 
J

John W. Vinson

What I need is a way to get from the Customers form into a new appointment
form with just the customers ID pre-populated.

Why not simply make the Appointment form a Subform of the customers form, with
the CustomerID as the master/child link field?

The alternative is to pass the customerID in the OpenArgs method of the
OpenForm command, and use the appointment form's Open event to set the default
value property of the CustomerID field to the passed value. Doable but a bit
of code which is completely unnecessary if you use a Subform; in addition, the
subform is simpler for the user, since the appointment form is right there
when needed.

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top