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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active X Calendar

Status
Not open for further replies.

tquest

MIS
Dec 17, 2002
7
US
I have a main form the user clicks a command button (find referred date) and it opens a calendar form. It then takes the date the user chooses and then puts into the referred date field on the calendar form. The referred date field on main form needs to display the date. The 1st records works fine. The next record doesn't capture the date. Referred date is a field in a table. And the table is accessed within the form with different fields. Any throughts on this greatly appreciated!

This is my code for the calendar form:
Private Sub calMyCalendar_Click()

If Me.Dirty = True Then
Me.Dirty = False
End If

MsgBox "Calendar clicked"
Me![referredDate] = calMyCalendar.Value

End Sub
 
Hi,

I don't understand why you are checking to see if the form has been modified - immediately setting it to un-modified and then not doing anything about it.

Whatever the reason, you may as well say:

Me.Dirty = False

... pointless checking with IF.

Can you explain in more detail what is happening pls?

I see it as this:

Mainform -> click button -> opens Calendar form -> Click calendar -> populates a field ON CALENDAR FORM.

Question 1:
You mention that it also updates a field on the Main form for the first record only (but you don't show code that does that). How is this working?

Question 2:
Are you shutting the Calendar form down, then moving to next record on Main form, then opening Calendar form up again?

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
The If statement allows for if you click on a date in the calendar, and then on another date, the date will reflect the new change.

I am shutting the calendar form down, then moving to the next record on main form, and then opening calendar form up again.

The click button to find date from the main form has the following:

Private Sub calDate_Click()
DoCmd.OpenForm "Calendar_Form"
End Sub

I do not really have any update code. I just bounded the controls, and for some reason the 1st one works.

Thinking more, couldn't I just copy the calendar form date to the main form somehow with a button on the calendar form?

Or maybe code something in if the next record button is clicked? I'm very lost on this one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top