need help with field refreshing

maxxximaniac

Registered User.
Local time
Today, 07:36
Joined
Oct 22, 2004
Messages
80
Hey all, I have attached here a sample of what im trying to do.

Basically i set up a combo box in a subform where an employee will select his name. I want the selection to be made only once because that same person will be entering data for a prolonged period of time.

I set up a linkchildfield on the main form to write to the main table.

My problem is. on a new record, the name from the combo box does not populate in the linkchildfield on the main form, and a selection in the combo box has to be made to send the dara over....

Can someone lend me a precious hand?

THank you very much, any help is appreciated!
 

Attachments

Field refreshing

I added a command button on the form, it takes you to a new record and populates the employee field with the value of the previous record.
Just look at the code in the OnClick Event.

Good Luck and Merry Christmas.
 

Attachments

:D thank you thank you thank you very much!

but i have a question, would it be possible to avoid having to click that button and somehow integrate that code somewhere else so they can just tab onto the next record? It would be much better to avoid having to click.

thanks again!
 
Great

You're welcome.

I guess you can put the code in the OnKey Press Event of the form, or even the After Update Event of the last field, but I don't think it's a good idea. If the users hit the assigned key by mistake it will go to a new record which they may not want. Another point is that they may go to a new record while the current one has not been completed yet.

It is my experience that it is better to have the user specifically choose to create a new record. And a click of the mouse does not really take more time than pressing a key.

Many developers also put some code in the Before Update Event of the form to check if all required fields have been filled out, and/or give the user the option to save the record or not.
 
ya thats a good point,
im just going to leave it as is... but now...
if the user actually does tab... it will go to the next record and not use the code.

to avoid that... is there away to disable going to a new record by tabbing through all the fields?
i.e. if you hit tab all day long it will just tab between fields and not change records
 

Users who are viewing this thread

Back
Top Bottom