Allen Browne's Popup Calendar

B

BillD

I had a problem with ActiveX control calendar to enter dates in a text box so
I switched to Allen Browne's Popup Calendar. I have set the control source to
the Date/Time field "DateLookingForWork". The format of the text box is set
to Short Date. The table field Data Type is Date/Time and the Format is set
to Short Date.
The Question I have is: Should the Control Source of the Text Box on the
Form be set to the Table Field Name "DateLookingForWork" or be Unbound as is
in his sample. If I set the Text Box to Unbound, then the date does not save
to the Table Field "DateLookingForWork" If I set the Control Source to the
Table Field Name "DateLookingForWork" then everything seems to work fine. I
am thinking that the reason he did not set the control source for the text
box on the form is that he did not have a table in the sample. Will I run
into future problems if I leave the Control Source set to the Table Field?

Bill D.
 
K

Ken Sheridan

Bill:

In your case you should set the ControlSource property of the text box to
the name of the DateLookingForWork column as you want to store the selected
date in the table. You could have situations where the control is bound, as
in your case, or unbound. An example of the latter is where you might have
two text boxes for selecting the start and end of a date range which is then
used to restrict the results in a report or form, sales figures for a certain
period for example. In the latter case the unbound text boxes would then be
referenced by code in a button's Click event, to open a report say, with:

Dim strCriteria As String

strCriteria = "TransactionDate Between #" & _
Format(Me,txtStartDate, "yyyy-mm-dd") & _
"# And #" & Format(Me,txtEndDate, "yyyy-mm-dd") & "#"

DoCmd.OpenReport "SalesReport", WhereCondition:=strCriteria

Ken Sheridan
Stafford, England
 
B

BillD

Thanks so much for the quick excellent reply. That answered my question and
gave me another way I can use the Calendar.
Thanks again,
Bill D.
 
B

Beeyen

Good Day,

I would like to add the day of the week and current time of the entry of
date selected. First is it OK to do since it was created by Mr Browne and if
so, could someone advise what the code should be in the form design of the
calendar.

Thanks
 
B

BillD

I can't answer that for you. Since this post is marked as answered, you
should start a new post in order to get responses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Allen Browne's Calendar 1
Allen Browne Calendar 5
Popup Calendar 1
Allen Browne's Calendar Sizing 3
Insert into (dates format) VBA 6
Allan Browne's calendar 3
Access Create option group without using wizard? 2
Calendar 2

Top