Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Datestamp continuous form (2002 SP-2)

    I would approach this by putting manual dates in the ones you want to futz with, and the run a query that updates all orders in the Invoiced state to put the current date in that field. A simple DoCmd.OpenQuery will run a stored query, or you can use a DoCmd.RunSQL with a SQL string.
    Wendell

  2. #2
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    Good to hear from you Wendell!

    If I enter the dates manually, and then run an update query, wouldn't that over-write the manual entries? (I could run a macro from the command button to close/open the form before running the query, but that would not allow me to view all the orders before printing them; which I like to do to be sure everything is correct). Hmm. . .
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Datestamp continuous form (2002 SP-2)

    If you enter some dates manually, then you would specify WHERE [DateStamp] Is Null in your update query. That way only the empty fields will be updated.
    Charlotte

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    Charlotte:

    Are you psychic? <img src=/S/yep.gif border=0 alt=yep width=15 height=15> <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Datestamp continuous form (2002 SP-2)

    Not today. <img src=/S/alien.gif border=0 alt=alien width=14 height=15> I was just responding to your question to Wendell.
    Charlotte

  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>
    No, I meant that I was just entering your suggestion when you posted. Weird.
    Have a great weekend!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  7. #7
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    Well. . .the query idea is falling on its face.

    In order for the query to take effect the form must be closed/opened. The txtInvoiceDate is the "key" in displaying orders that are "billed"; if there is a date found in the txtInvoiceDate then the order no longer appears in "invoiced" status, but rather "billed" status (when an update query is run after a print function). I need to populate the null value dates from the command button without refreshing the form (if that's even possible).

    Oh, to be code illiterate!
    Need some sleep. . . <img src=/S/doze.gif border=0 alt=doze width=15 height=15>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Datestamp continuous form (2002 SP-2)

    Try a Me.Refresh in the form. If that doesn't work, Me.Requery.
    Charlotte

  9. #9
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Datestamp continuous form (2002 SP-2)

    If I follow your logic correctly, there won't be any orders left in an Invoiced state after you run the query, so why not run the code as a part of closing the form - you probably want a bail-out command button as well that would close the the form without running the query. But the concept should still work - and the query processing will be independent of what the form shows, so I think you should be in good shape.
    Wendell

  10. #10
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    Sorry folks. I'm apparently guilty of some rather backward thinking and sleepless logic.

    As only a minority of these entries would be changed, it (seems) the logical thing to do would be to have the form open with the InvoiceDate set to default Date() and then manually edit those date(s) if desired. Still the code infant, I'm having difficulties getting it to do that. While I am entering "Date()" (no quotes), VBA is correcting it to "DATE". I don't get any error messages when I open the form, but it doesn't enter the current date either. While I'm accustomed to VBA making suggestions as I type, it is dreadfully silent in this attempt (maybe that's a clue?)

    Private Sub Form_Load()
    InvoiceDate.DefaultValue = DATE
    End Sub
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  11. #11
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    Why do you want to set the default value in the form?
    Wouldn't it be better to define it in the table ?
    Francois

  12. #12
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    Francois:

    Thanks for your input! "Why do you want to set the default value in the form?" Probably because I don't truly understand default values.
    If I define InvoiceDate in the table, wouldn't that mean that all orders throughout the application would have a date entry? This form is designed to enter those date(s), and the criteria for it even displaying these orders is that no date has yet been entered. Does that make any sense?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  13. #13
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    I wasn't aware that you want to edit existing records instead of creating new one's.
    The default value function populate a field only when you are creating new records. No matters these default value are set at table level or form level.
    What you could do is insert code in the on current event of the form :
    <pre>If IsNull(Me.MyDateTextBox) Then
    Me.MyDateTextBox = Date
    EndIf</pre>

    Francois

  14. #14
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    Now that's what I'm talkin' about!

    It's a ways back up the thread, but I did mention that this was a continuous form. It now opens with the current date in the first record, but I need to Tab through each one for the default date to be entered (not a big deal), but is there some way for all of the records to display current date? I really appreciate the help; this is already much better.

    <pre>Private Sub Form_Current()
    If IsNull(Me.InvoiceDate) Then
    Me.InvoiceDate = DATE
    End If
    End Sub</pre>

    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  15. #15
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Datestamp continuous form (2002 SP-2)

    I'm afraid I'm out of ideas here <img src=/S/sad.gif border=0 alt=sad width=15 height=15> Maybe someone else.
    Francois

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •