Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a value between insert operations

Status
Not open for further replies.

bstacy1

Technical User
May 21, 2002
11
0
0
US
Hello all,

I have a relatively simple form with a few text boxes and a Calendar Control. Since users will be entering records on this form usually for the same date all at once, I would like to pass the date Calendar.Value from one record to the next without the user needing to select it each time. This seems as though this should be very simple, but I can't seem to grasp the best way to do this. Any suggestions?
 
Take a look at the DefaultValue property of the Control object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I do not have DefaultValue property available to me with this control.
 
ALL TextBox have a DefaultValue property ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes they do, but as it turns out I am not referring to a text box I am referring to a Calendar Control.
 
And where is supposed to go the picked value ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This is an ActiveX calendar control on an Access Form. The Calendar control is bound to a date field in the table that the records are being inserted into. At the moment, everything works fine provided that I select the date from the control for each record.

When I first enter the form, I would like to only have to select the date from the calendar control once unless I need to enter records from another date at which time I could change it.

My suspicion is that this can be done by passing the inserted record's date value to a variable each time an insert is performed, then pass that value to the control for the next record. I am just having problems determining the best way to do this.
 
I figured it out simplified code below for anyone else that has a brain fart along these lines:


Option Compare Database
Dim gFaxDate As Date
---------------------------------
Private Sub CalFaxDate_Exit(Cancel As Integer)
gFaxDate = CalFaxDate.Value
End Sub
---------------------------------
Private Sub Form_Current()
CalFaxDate.Value = gFaxDate
End Sub
---------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top