Need to automaticallu input date in form

This seems to be a very popular question posed on the forum, and I have read
through and tried the most viable solutions given to others. I have three
diferent forms that update a table with three different date fields. Although
I have set the default value for all the date fields in the table to =Date()-
1, this only works on one of the forms, even though that field in each form
is given same properties.

The forms are used to update an inventory table containing part numbers, wip
dates and amounts, packing dates and amounts, and shipping dates and amounts.
I use the three different forms because not all the same part numbers have
records in each category each day. I typically update the tables the next day,
hence the Date()-1. This works well during the week, but not on Monday or if
I skip a day and have to enter data from more than one day ago.

The better solution would be to have a box on the form into which I could
input the date for the transactions being made, which would then
automatically fill in the date for the individual transaction. Is there a
reasonable way to do this? Thanks.

0
mhudson
8/7/2007 6:17:37 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
560 Views

Similar Articles

[PageSpeed] 19

If you're saying you want to sit down, enter the first transaction record for
a given day and enter the date, then have that date automatically filled in
for each ensuing record until you start entering records for another date (
and change the date manually to start the new series of records) then you can
use the DefaultValue property of the control on yur form holding the date.

Private Sub YourDateControlName_AfterUpdate()
If Not IsNull(Me.YourDateControlName.Value) Then
  YourDateControlName.DefaultValue ="#" &  Me.YourDateControlName & "#"
End If
End Sub

where YourDateControlName is the actual name of the textbox holding your
transaction date. After entering the date, it will automatically fill in the
each record thereafter until you manually change the date. Then it will start
over again and do the same thing with the new date.

-- 
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

0
missinglinq
8/7/2007 6:53:52 PM
missinglinq wrote:
>If you're saying you want to sit down, enter the first transaction record for
>a given day and enter the date, then have that date automatically filled in
>for each ensuing record until you start entering records for another date (
>and change the date manually to start the new series of records) then you can
>use the DefaultValue property of the control on yur form holding the date.
>
>Private Sub YourDateControlName_AfterUpdate()
>If Not IsNull(Me.YourDateControlName.Value) Then
>  YourDateControlName.DefaultValue ="#" &  Me.YourDateControlName & "#"
>End If
>End Sub
>
>where YourDateControlName is the actual name of the textbox holding your
>transaction date. After entering the date, it will automatically fill in the
>each record thereafter until you manually change the date. Then it will start
>over again and do the same thing with the new date.
>


Excellent, excellent, that did exactly what I wanted it to do. Seeing as how
I am still a greenhorn at Access, once I figured out that the code goes into
the VB editor for the control for the form (not your fault!) everything
worked just like I want it to. Thanks for your quick response and a great
solution!

0
mhudson
8/7/2007 8:39:59 PM
Reply:

Similar Artilces:

need to share calendar
Hi Its a peer to peer network, no exhange server, just popping email. We use the calendar and would now like to see each others. I am under the impression I do this but don't know how to do it. We have outlook 97 and outlook 2000. Thanks Will Will Kubly <wkubly@wi.rr.com> wrote: > Its a peer to peer network, no exhange server, just popping email. We > use the calendar and would now like to see each others. I am under the > impression I do this but don't know how to do it. We have outlook 97 > and outlook 2000. http://www.slipstick.com/outlook/share.htm will ...

Cell Change Color
Hi Bob, Thanks for the quick reply. I've tried it but it didn't work as expected or maybe i did something wrong. I've already click and paste the script as instructed but no change. I've attached a screenshot of what I intend to do. For column A will be the timer which will be updating according to my earlier description. Column B is the System name and column C is the Status which I need help. Thanks again Bob. -- alani Not sure Alani. Why don't you send me your workbook direct, and I will install it. -- HTH Bob Phillips "alani" <alani.1re19w@new...

Need a special kind of "sort"... #2
Merlin & Ron, I got back to work on this after I posted and came up with a VB solution that works every time (and fully customizable too). I thin it's similar to both of your solutions... (itemList is a two dimensional array defined in a previous step) ' my custom sort "dictionary" testStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ReDim newArray(1, UBound(itemList, 2)) ' Run characters of the array against testStr and find it' position in testStr For X = 1 To UBound(itemList, 2) ' Convert each of the three positions in the 1st matrix to string T...

Grouping on certain years - help needed please
Hi I have a database in Access 2007 that records details of sports clubs and historical results. Records start in 1929 to present date with a break for World War 2 I have reports showing League tables etc. One report shows all the clubs history on one page with club details at the top, then line by line history of results (Played/Won/Drew/For/ Against etc) However, I would like to group these latter results in pre-war (1929-1939) and post-war (1946- ) periods (all on the same report) I'd like advice please as how best to do this Many thanks Neil neil40@btinternet.com wrote: >I hav...

Date Formats Available
Hi, I was wondering if there was a date format that anyone was aware of that would make the date appear as such: Entered in as 30/12/1979 Displayed as 30th December, 1979 Thanks in Advance, RTANSW -- Message posted via http://www.officekb.com You'd need a VBA event macro to do this. If you can live with 30 December, 1979 then Format/Cells/Number/Custom dd mmmm, yyyy will do. In article <374548a98acd4a7189b14ca738876735@OfficeKB.com>, "RTANSW via OfficeKB.com" <forum@nospam.OfficeKB.com> wrote: > I was wondering if there was a date format tha...

Excel Adding years or months to a date
I want to be able to add months or years to a date. For example 25/4/05 + 9 months 25/4/05 + 15 years. I am using Excel 2000. The standard way is: =DATE(YEAR(A1),MONTH(A1)+9,DAY(A1)) to add 9 months. For 15 years try: =DATE(YEAR(A1)+15,MONTH(A1),DAY(A1)) HTH Jason Atlanta, GA "Joan" wrote: > I want to be able to add months or years to a date. > > For example 25/4/05 + 9 months > 25/4/05 + 15 years. > > I am using Excel 2000. On Mon, 25 Apr 2005 06:54:03 -0700, "Joan" <Joan@discussions.microsoft.com> wrote: >I want to be able to a...

Line chart: Dates in uneven intervalls on x-achsis #2
'Supplementary' questions: Is there a clever way to make excel recogniz that '3 months' stands for '0.25 years', and '6 months' stands for '0. years'? I know, this is only cosmetics. Nevertheless it would be interesting ;) Gil -- gdavid ----------------------------------------------------------------------- gdavids's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1589 View this thread: http://www.excelforum.com/showthread.php?threadid=27378 You could use a helper column that divides months by 12 to scale as years. Jer...

Help is needed with Conditional Formatting drudgery
I am trying desperately to reduce mouse clicks (and carpal tunnel syndrome risk!) with the following problem: I have 90 SETS of three price calculations, each trio equipped with its own drop down list which determines whether certain cells should be blacked out. The calculations are distributed among 30 tabs, an average of 3 sets of calculations per each tab. I have been copying the blank forms over the different tabs and I have been manually adjusting (a) the cell links for each drop down list and (b) all the conditional format formulas (I have been using the format painter to as m...

Resetting Form Fields
Hi, I have the following Macro which I thought should not reset form fields but each time its used and it relocks the form the formfields are reset, please could someone be kind enough to point me in the right direction of where it is going wrong? Thanks Robin Sub OnExitSite1a() Dim bProtected As Boolean Dim rText As Range Dim oFld As FormFields Dim sPassword As String Set oFld = ActiveDocument.FormFields Set rText = ActiveDocument.Bookmarks("CheckSiteResult1a").Range sPassword = "" 'password if any to unprotect the form 'Unprotect the file If ...

Need Help on Ranking
I am looking for a formula to rank the position of a person based o tasks completed. Conditions: The total number of tasks is the same for all (18) More then one person can have the same amount of tasks done placin them in the same ranking. Ranking Must be in a linier progression without skipping ANY number (RANK 1,2,3,4,5 etc�) The end result will need to look something like this TOTAL TASKS: 18 NAME----TASKS DONE---------RANK John------------4--------------------3 Bill---------------2-------------------5 Karen-----------4-------------------3 Jim---------------3-------------------4 Sal...

Public Folders needed from Exchange 2003 Server no longer in AD
An Exchange 2003 Server holding Calendars and Public Folders did not have Replication set up with other Exchange 2003 Servers on the network and was removed from the Active Directory before this was discovered. Thereby, users are unable to get into their Calendars. We are now looking for the best scenario to recover the Folders and Calendars from the Exchange Server that is no longer included in the Active Directory. Is there a way to add the Exchange Server back? Or is the best bet to restore from tape? Thank you in advance! On Wed, 25 Oct 2006 13:53:02 -0700, ammathest <a...

Transaction dates change when synching with bank
I've noticed that whenever I synch with my bank and everything is automatically updated, or whenever I do a download and manual update, all of my transaction dates change. For example, if I write a check on the 15th and it clears the bank on the 20th, the transaction date change to the 20th. Is it just me or does anyone else have a problem with this? I want to know when I wrote a check or made some transaction, not necessarily when it cleared the bank. I can see where this information would be useful and it would be great if Money could track both in the register but if we can o...

Control Form form a Sub Form
How do I activate a command button on the main form when I double click on the sub form? "TonyAntique" <u59027@uwe> wrote in message news:a5a6118d13dbf@uwe... > How do I activate a command button on the main form when I double click > on the sub form? The code would be like this: Me.Parent!Command99.Enabled = True But you'll need to define "double-click on the subform" more precisely. It's probably the dblClick event of the subform's Detail section you want to use. -- Allen Browne - Microsoft MVP. Perth, Western Australia T...

Text Box to Enter Date
IF Text Box [tbA] is to have today's date entered into it , if Text Box [tbB] has any text entered into it......What code do I need for [tbA] in after update.......Thanks for any help,................Bob Oops figured it out sorry, If tbA.value = "" Or IsNull(tbA.value) Then tbA.value = Format(Now, "dd-mmm-yy") "Bob" <bob@the.races> wrote in message news:f2u99a$ob2$1@lust.ihug.co.nz... > > > IF Text Box [tbA] is to have today's date entered into it , if Text Box > [tbB] has any text entered into it......What code do I need ...

Date/Time stamp with one stroke?
I know that you can have Excel insert the current date with CTRL + ; and the current time with CTRL + SHIFT + :. Is there some way to insert both with one command? I know it seems like a small thing, but we have a worksheet for employees to keep track of completed tasks. When they complete a given task, they need to put the date and time of completion in a specific cell. However, over the course of a day, they may be completing upwards of 250 tasks. Even lessening the time to complete the time stamp by a single set of keystrokes would be helpful. As an additional note, I did try c...

using the standard input from an MFC application
I have an VS6.0 MFC dialog application. and I want to use the standard input and output. I want my application to support a protocol (UCI) that will comunicate with my application through the standard inout/output. How can I do it? I've tried: cout<< "Hello world" ; does nothing cin.getline( line, 100); does nothing cin >>line ; does nothing what an I doing wrong? Thanks Dudu I wonder if you can use ReadConsoleInput(...) to do that. AliR. "dududuil" <dududuil@discussions.microsoft.com> wrote in message news:0F7135BB-E65D-4461-A08C-425003BCBE4...

Still need help
I have a spreadsheet that is 3604 rows & 6 columns. Column E has only hyperlinks to URL's. I have filtered my data via column B. I tried to A-Z Column A. When I do, the hyperlinks do not stay with the data. The mask looks correct but when you scroll over the hyperlink you see a completely different URL.????? Can anyone tell me how to make sure the Hyperlink keeps the correct URL when filtering and sorting the data. "Tim Williams" wrote: > Try using the =HYPERLINK() worksheet function Thanks Tim for answering, hoping you're still there. I tried it and i...

Date Difference Report
I have a query (qryShear) that selects records from a table (tblLbrHrs). Example follows... EqNoDesc EqNo Desc CompDate Shear_A 1250 desc.detail 08/27/05 Shear_A 1250 desc.detail 09/09/05 Shear_C 1475 desc.detail 05/13/05 Shear_B 1800 desc.detail 03/05/05 Shear_A 1250 desc.detail 05/27/05 Shear_B 1800 desc.detail 03/25/05 Shear_C 1475 desc.detail 05/24/05 I want to run a report that produces the following results... Equipment ...

Disable auto (date) format?
In A3, I have a formula of the form =A1/A2/24, where A2 is time (date serial number) formatted h:mm:ss. (A1 is a number formatted as General.) When A3 is formatted as General, Excel changes the format to h:mm:ss every time I edit A3. I have to change the format back to General manually, which is a nuisance. I can avoid this by formatting A3 as Number. But I would like it remain General. Is there any option setting that disables this autoformat heuristic? I don't mind if it turns off all "intelligent" autoformat selection. I am using MS Office Excel 2003 ...

How do I find what table a field name from a form is in?
I've looked in properties in design view on the form and can't seem to find out what table the field is linked to. Any help would be appreciated. A table can be the form's Record Source. A control such as text box can have a Control Source from the Record Source table. If you look at a text box properties and see that it has a Control Source from a table, the Form's Record Source property will tell you which table that is. A query may include several tables, so if the Record Source is a query you may need to open the query in design view to discover the table or calc...

Building Form
Dear all, I have tables with this fields: expenses_control: expenses_code, profit_center, date, value. date: date profit_center: profit_center_code, profit_center_description expenses: expenses_code, expenses_description The relationship between the tables are: expenses_control.expense_code =3D expenses.expense_code expenses_control.profit_center =3D profit_center.profit_center_code expenses_control.date =3D date.date Now I'm trying to do a form to imput, to include and to exclude data/ values (not for consults!), like that: -----------------------------------------------------------...

Date problem #6
This small equation is kicking my butt. Could someone enlighten me. I am simply trying to compare 2 dates if the date in cell c2 is less that "12/31/08" then put the value , or else put " future " This is what I came up with =if(c2<12/31/08, c2,"future") c2 is in the form of 5/17/08 How do I format the comparison date? I have tried it a few ways, with no luck. Appreciate any help -- KWB You could use: =IF(C2<DATEVALUE("12/31/08"),C2,"future") or =IF(C2<DATE(2008,12,31),C2,"future") Tyro "Kelvin" &...

linking two sub-forms withing a form
Hi, Thanks for the advice to use subforms. Now I have another problem. I have a form (which is basically just titles, etc, no actual records) into which I have inserted two subforms - the first to serve as a row heading (left) and the second to show the records (right) - basically it is a form createad with a crosstab query which has been split into two sub-forms (one row heading and one for the actual values). Can anyone give a suggestion how I could connect these two subforms so that when I scroll one of them the other will scroll with it automatically - and the scroll bars on the ma...

Epay and processing date flag issue
I had Money's options set to turn off the "enter epays on the processing date" but for some reason the settings got lost. So I now have a transaction with the processing date, which is not how I bank (the MSN Bill Pay will debit on the pay date, not the processing date), and it's messing up my Cash Flow. Does anyone know how to fix an existing transaction, short of cancel and reissue? Thx. ...

save new record with one form
I created a form to add several pieces of information to a table. I then added a button at the bottom that I thought was suppose to save each record as a NEW recod. The problem is when I click the button it will save it as a new record, but if I close the application and go to add a new record later it automatically pops-up with the latest entry. I then just edit the information in the form and it doesn't save the record as a new entry.... it saves it as the last entry like I was editing. How do either add code so it will always save as a new record or when I open the form it wi...