469,270 Members | 1,314 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,270 developers. It's quick & easy.

Setting Value in an Open Form

I'm currently developing a Fleet system which enables the user to enter
Parts used to Service a vehicle. The parts are available through a
Combo Box on a form and if the user enters a new Part the systems
checks the NoinList and then opens a new Form where the user can enter
the new Part Details i.e. price, VAT Rate, Supplier etc.

What I'd like is for the value entered in the Combo box for the new
part e.g. Fuel Filter, to appear in the Part entry form as the default
for the Part Description i.e. the newdata string.

Is this possible ?

Thanks for your help,

Elfyn

Nov 13 '05 #1
4 1701

<el***@ibabyshop.co.uk> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I'm currently developing a Fleet system which enables the user to enter
Parts used to Service a vehicle. The parts are available through a
Combo Box on a form and if the user enters a new Part the systems
checks the NoinList and then opens a new Form where the user can enter
the new Part Details i.e. price, VAT Rate, Supplier etc.

What I'd like is for the value entered in the Combo box for the new
part e.g. Fuel Filter, to appear in the Part entry form as the default
for the Part Description i.e. the newdata string.

Is this possible ?

Thanks for your help,

Elfyn


You could simply re-query the combo and then set its .value property to the
newdata string. However, you need to consider the case where the user
starts to enter a new part but then changes his mind - perhaps you could use
two buttons OK and Cancel and only if the OK button is pressed do you save
the new part, requery the combobox, set the value to the new part number,
then close the popup form.

PS getting feedback is what keeps people donating their time for free - you
didn't say whether your subform post had pointed you in the right direction.
Nov 13 '05 #2
Thanks for that Justin,

But how do I get the value of the combo box into the description field
of a pop-up form ?

Nov 13 '05 #3

<el***@ibabyshop.co.uk> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Thanks for that Justin,

But how do I get the value of the combo box into the description field
of a pop-up form ?


One easy way is to use the form's OpenArgs property, and specify it when you
use DoCmd.OpenForm. In this way, whenever the form is opened you look to
see if there is a new part given in the OpenArgs. If there is then it means
the user wants to add a new part, so you can start a new record and set the
part number (or whatever you supply) on the parts form.
You can look in the help file for OpenArgs, but if you still need help, post
back.
Nov 13 '05 #4
Ola E:

One oddball thing to be aware of is that the code generated by the
Access 2K button creation wizard places the .OpenArgs argument in the
wrong place. In Access 2k, the .OpenArgs value is actually the 8th
argument to the DoCmd.OpenForm command. The intellisense gets it
right.

King Ron

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jim Witte | last post: by
11 posts views Thread by Zlatko Mati | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.