If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Click Checkbox to add date in a text box

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-08-06, 13:46
ranjah ranjah is offline
Registered User
 
Join Date: Jul 2005
Posts: 137
Red face Click Checkbox to add date in a text box

Hello All,
I have built a database for ordering parts and as soon as i receive parts i then check the box called received and it takes that entry away from the form and keeps it in the table, however i want the received orders archived from the date they were checked on.

I am using 0 criteria for the checked box field which basically removes it from the form but keeps it in the table however i want another field to have a date/time added as soon as the box is checked.

I hope i am making sense.
I have tried several ways of making a on click event but i cant get the code to work right.
Any help would be wonderful

Thanks
Attached is my database
Attached Files
File Type: zip order.zip (14.5 KB, 54 views)
Reply With Quote
  #2 (permalink)  
Old 09-08-06, 15:40
Missinglinq Missinglinq is offline
Registered User
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 1,702
You need to add a textbox to your form called, for instance, ReceivedDate, formatted as a date. In the Properties box set its Control Source as RecievedDate. Then in VBA code enter:

Private Sub Recieved_Click()
Me.ReceivedDate.Value = Now()
End Sub

When you click on the Recieved checkbox the date will be placed on your form and in your table.
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2000/2003
Reply With Quote
  #3 (permalink)  
Old 09-08-06, 15:47
myle myle is offline
(Making Your Life Easy)
 
Join Date: Feb 2004
Location: New Zealand
Posts: 1,143
Private Sub Recieved_Click()
Me.ReceivedDate.Value = Now()
Me.Requery
End Sub
__________________
hope this help

See clear as mud


StePhan McKillen
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment:
Access based on my own environment: DAO3.6/A97/A2000/A2003
VB based on my own environment: vb6 sp5
ASP based on my own environment: 5.6
VB-NET based on my own environment started 2007
SQL-2005 based on my own environment started 2008
MYLE
Reply With Quote
  #4 (permalink)  
Old 09-11-06, 13:06
ranjah ranjah is offline
Registered User
 
Join Date: Jul 2005
Posts: 137
Angry Where do I enter the VBA code?

Quote:
Originally Posted by Missinglinq
You need to add a textbox to your form called, for instance, ReceivedDate, formatted as a date. In the Properties box set its Control Source as RecievedDate. Then in VBA code enter:

Private Sub Recieved_Click()
Me.ReceivedDate.Value = Now()
End Sub

When you click on the Recieved checkbox the date will be placed on your form and in your table.
Thanks to Missinglinq and Myle for the prompt reply!
I went ahead and createda field called ReceivedDate properties set to shortdate and after placing that code to onclick event of the received checkbox and it work flawlessly.

You guys are just awsome, i know i can always count on you.
thanks again

Last edited by ranjah; 09-11-06 at 13:39.
Reply With Quote
  #5 (permalink)  
Old 09-12-06, 10:11
ranjah ranjah is offline
Registered User
 
Join Date: Jul 2005
Posts: 137
I have one more question, How do I enter a comment such as " Are you sure you want to received that order" before it executes the command?

Thanks again
Reply With Quote
  #6 (permalink)  
Old 09-12-06, 15:12
myle myle is offline
(Making Your Life Easy)
 
Join Date: Feb 2004
Location: New Zealand
Posts: 1,143
try some like

Code:
if msgbox("Are you sure you want to received that order",vbYesNo)  = vbYes then 
Me.ReceivedDate.Value = Now()
Me.Requery
Else

End if
__________________
hope this help

See clear as mud


StePhan McKillen
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment:
Access based on my own environment: DAO3.6/A97/A2000/A2003
VB based on my own environment: vb6 sp5
ASP based on my own environment: 5.6
VB-NET based on my own environment started 2007
SQL-2005 based on my own environment started 2008
MYLE
Reply With Quote
  #7 (permalink)  
Old 09-13-06, 13:23
ranjah ranjah is offline
Registered User
 
Join Date: Jul 2005
Posts: 137
Thanks Myle!
that worked just fine
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On