473,320 Members | 2,158 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,320 software developers and data experts.

autofill current date in subform field

I have a search form with a query-linked subform.

One of the fields in the subform are date fields.

Is there a way to autopopulate the DateFilled field when the person
enters the field? I need this to be code which is entered into the
form, rather than as a property of the field in the table because
there is other data which is entered before. This data is entered in
at a later date.

example

OrderNum ProductName Qty DateOrdered DateFilled
---------------------------------------------------------------------------------
439 Round To-it 3 2/2/2001 N/A
440 Round To-it 2 2/12/2001 2/2/2002
441 Round To-it 4 2/18/2001 =Date()

where record 441 is the one being entered in the subform.
Apr 21 '06 #1
1 4244
in the form, try adding the following code to the date control's Enter event
procedure, as

If IsNull(Me!DateFieldName) Then Me!DateFieldName = Date

the above must go all on one line in the VBA window, or it won't run.

hth
"Stephen D Cook" <st******@comcast.net> wrote in message
news:m4********************************@4ax.com...
I have a search form with a query-linked subform.

One of the fields in the subform are date fields.

Is there a way to autopopulate the DateFilled field when the person
enters the field? I need this to be code which is entered into the
form, rather than as a property of the field in the table because
there is other data which is entered before. This data is entered in
at a later date.

example

OrderNum ProductName Qty DateOrdered DateFilled
-------------------------------------------------------------------------- ------- 439 Round To-it 3 2/2/2001 N/A
440 Round To-it 2 2/12/2001 2/2/2002
441 Round To-it 4 2/18/2001 =Date()

where record 441 is the one being entered in the subform.

Apr 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lphuong | last post by:
Access 2000 I have a fldCreateDate on frmCustomer(mainform)and also a fldCreateDate on frmCustomerVisit(subform). They are one to many relationship. On the main form, frmCustomer, I have a...
1
by: jmarr02s | last post by:
I created a subform with 4 separate fields (textboxes) each containing an 8 digit date I want the most current date to show in each of the four fields So under properties for the subform...
10
by: sandraz444 | last post by:
I have an expression in the query under my form to autofill the date under a certain condition but it wont write to the underlying table?? The date shows in the form but not the table. Does anyone...
5
by: Sherry | last post by:
Is there a way to automatically, or by using say a function key, call/paste into a current table or query's field the same value entered for the same field in the immediately preceeding record,...
5
by: christianlott1 | last post by:
I admit my form is pretty complex and may need a total overhaul - I have two subforms synchronized on a form through an unbound text box. When I enter a new record in the second subform it used...
8
by: tess | last post by:
I have: table 1 - tblLeadInfo which includes a salesman ID field table 2 - tbllkpSalesman with all zips in the state and a Salesman assigned to that area. I have a form based on table #1 When...
1
by: dvorasnell | last post by:
Hello, I have a fairly simple database. In this dbase, there is a subform which basically holds menu values for the records. These values serve as the "notes" for each record. OK, I find that I...
2
rsmccli
by: rsmccli | last post by:
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....
12
by: klbrownie | last post by:
Hello, I am trying to get a date field to autofill based on the date of another date field. I want the autofilled date to be 30 days after the other date. For example, if the user has entered...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.