473,394 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Want values in form to autofill when a new record is made. Which event?

rsmccli
52
Access 2002

Hi, I have a number of comboboxes/textboxes in the header of a form that the user selects values from. These comboboxes/textboxes correspond to controls in a datasheet view subform. When a new record is created in the subform I want these values to automatically write to the new record in the subform.

Right now I have this autofill procedure running on the AfterInsert event of the subform. It works well, except for the fact that the user has leave the record before the values are updated.

Example:

Now: A user creates a new record by entering a SSN in that control. When the user tabs to the next control, no values are autofilled. The user must leave the current record for the autofill to work.

What I want: A user creates a new record by entering a SSN in that control. When the user tabs to the next control or clicks on another control on the same record, the values are autofilled.

I have considered some other events, but I definitely would not like access to overwrite anything if, say, the user clicked on a previously created record to change a mistake in the SSN.

I appreciate any help on this.

rsmccli
Apr 7 '08 #1
2 4228
PianoMan64
374 Expert 256MB
Access 2002

Hi, I have a number of comboboxes/textboxes in the header of a form that the user selects values from. These comboboxes/textboxes correspond to controls in a datasheet view subform. When a new record is created in the subform I want these values to automatically write to the new record in the subform.

Right now I have this autofill procedure running on the AfterInsert event of the subform. It works well, except for the fact that the user has leave the record before the values are updated.

Example:

Now: A user creates a new record by entering a SSN in that control. When the user tabs to the next control, no values are autofilled. The user must leave the current record for the autofill to work.

What I want: A user creates a new record by entering a SSN in that control. When the user tabs to the next control or clicks on another control on the same record, the values are autofilled.

I have considered some other events, but I definitely would not like access to overwrite anything if, say, the user clicked on a previously created record to change a mistake in the SSN.

I appreciate any help on this.

rsmccli
The simplest way to do that is simply bind to the control of the other fields that you wan to auto-populate a DLOOKUP Statement and have it search on the Lost focus event of the SSN field. this way, you can have it populate as many fields as you'd like it to.

Hope that helps,

Joe P.
Apr 7 '08 #2
FishVal
2,653 Expert 2GB
.....
Now: A user creates a new record by entering a SSN in that control. When the user tabs to the next control, no values are autofilled. The user must leave the current record for the autofill to work.

What I want: A user creates a new record by entering a SSN in that control. When the user tabs to the next control or clicks on another control on the same record, the values are autofilled.
........
Hi, there.

It pretty looks like you you are going to duplicate information which is generally unacceptable practice (Database Normalization and Table structures).
Form controls may be "autofilled" by using table join as form recordsource. Thus when user fills FK field bound control all controls bound to PK table are being populated to fulfill the join.

Regards,
Fish
Apr 7 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Robert Neville | last post by:
I would like to add filter functionality to my database whether through the Main form or the subform. This question may be rudimentary, yet I have not less experience with filtering data outside...
15
by: Steve | last post by:
I have a form with about 25 fields. In the BeforeUpdate event of the form, I have code that sets the default value of each field to its current value. For a new record, I can put the focus in any...
2
by: LCalaway | last post by:
Happy 4th, all How do you turn off the following type of autofill: Example: I have created a table with four text fields. When entering numeric data in these fields, by the third field, a...
12
by: swingingming | last post by:
Hi, in the NorthWind sample database, when clicking on the next navigation button on the new order record with nothing on the subform (order details), we got an order with nothing ordered. How can...
3
by: jrbrady | last post by:
I'm having a rather vexing problem with my VB.NET ASP.NET application: Briefly, on rare occasions, when a user of my site presses a button to move from one record to another, and the Page_Load...
3
by: Darin | last post by:
I have a problem I just can't figure out. I have a form with a subform, and the recordsource of the subform has criteria based on some unbound fields in the parent form so that data in the parent...
1
by: Confused Newbie | last post by:
Hey there Gang, I am in need of some assistance. Ok here is my scenario. I have a Form (Query) that will have multiple users editing information in a Table at the same time. I need the reps to...
1
by: Rissoman | last post by:
Hello, I have an issue were I have a zipcode textbox in an atlas ajax updatepanel. When you tab out of the zip textbox and the shipping is calculated. I know this works perfect! Then a user...
16
by: GLEberts | last post by:
Subject: Trying to open up a record in a form called "fmappointment" when clicking on a "looks like hyperlink" text box called "ContactID" I have made many instances of this in my database but in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.