473,772 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4266
in the form, try adding the following code to the date control's Enter event
procedure, as

If IsNull(Me!DateF ieldName) Then Me!DateFieldNam e = Date

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

hth
"Stephen D Cook" <st******@comca st.net> wrote in message
news:m4******** *************** *********@4ax.c om...
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
7654
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 Before Insert event call a MacroCustomerCreateDate Action: setvalue Item: !! Expression: Date( ) This is working fine; I got the current date as soon as I input
1
1497
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 under Order By I entered the following: SATermDate DESC, CMSTermDate DESC, SATermDateRescinded DESC,
10
2852
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 know a solution for this? Thanks!
5
2927
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, when values for a given field are often repetitive? I have a record with 7 fields that will be the same of all the records, only 2 fields (id number & amount) will differ. I am trying to save the client unnecessary keystrokes. Thanks, Sherry
5
6992
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 to complain about nulls and then about 'can't repeat an index'. To solve this I wrote code on the main form's subform enter event (I'm surprised I found it. I must have spent an hour trying to program the enter and exit events from the subform...
8
2368
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 I enter the zip code in the form, I'd like the Salesman ID field in tblLeadInfo to fill in accordingly and also show the salesman name on the form. I'm sure this is simple, I just can't seem to get it straight in my
1
2174
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 am typing a rather long string in many "notes" section of the subform. Rather than have to type this over and over again, I would like to automate this procedure. So I have tried to create an "Event Procedure" to accomplish this, but so far, the...
2
4257
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. 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...
12
15987
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 06/15 in the first date field, I want the second field to automatically populate with 7/15. I have tried everything I can think of to no avail! I can't imagine this is a difficult thing to do........ Anyone have any ideas?
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9911
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.