A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Re-Post - help please



 
 
Thread Tools Display Modes
  #1  
Old July 1st, 2004, 05:57 PM
K Crofts
external usenet poster
 
Posts: n/a
Default Re-Post - help please

Hi, i have posted this previously but maybe did not
explain myself well enough to receive any help.
I have a calender control on my form, when a date is
selected on it it puts this date into a text box
(''Date'').
I need to be able to click on a date on the calender and
bring up the relevant record for that date (i thought the
addition of the text box would make coding easier), if no
record exists i need a new one to be created.
Any help at all would be appreciated.
Ta


  #2  
Old July 2nd, 2004, 11:57 AM
Al Borges
external usenet poster
 
Posts: n/a
Default Re-Post - help please

Hi Ta:

As you've already seen, the events on the Calendar Control suck... but
here's what I've done to get around them. In one of my projects, I use the
Calendar control to select a date, then use that date to select a particular
physician's list of patients:

1) on my form I have the Calendar control ("ocxCalendar"), a clickbutton
("command73"), and a combobox ("Combo21"), and the subform with the list of
patient appointments
2) Combo21 brings up the list of physician names; there are 2 procedures
associated with this combobox:

Sub Combo21_Change()
If Not IsNull(ocxCalendar.value) Then
[SCHDATE] = ocxCalendar.value
End If
Set dbs = CurrentDb()
Set rst = Forms![scheduler1]![Scheduler2b].Form.RecordsetClone
If rst.RecordCount = 0 Then
Forms![scheduler1]![Scheduler2b].Form![Frame51].Visible = True
GoTo last:
End If
rst.MoveFirst
rst.MoveLast
If rst.RecordCount 10 Then
Forms![scheduler1]![Scheduler2b].Form![Frame51].Visible = True
End If
rst.Close
dbs.Close
GoTo last:
last:
Forms!scheduler1!Scheduler2b.Form![Text50] = Me![Combo21]
Forms!scheduler1!Scheduler2b.Form![Text41] = Me![ocxCalendar].value
Forms!scheduler1!Scheduler2b.Form.Refresh
Forms!scheduler1!Scheduler2b.Form.Refresh
Me.Refresh
Exit Sub
End Sub

Private Sub Combo21_NotInList(NewData As String, Response As Integer)
MsgBox "You have typed in the wrong name! Please try again. If you wish to
change the physician name, press the cardfile button to the right."
Exit Sub
End Sub

3) The ocxCalendar's only active procedure is:

Private Sub ocxCalendar_LostFocus()
If Not IsNull(ocxCalendar.value) Then
SCHDATE = ocxCalendar.value
End If
End Sub

' Note that this procedure is activated once the user clicks on either the
clickbutton or the combobox.

4) The subform is linked to the Parent form by the 2 key fields- SCHDATE
(the selected date field) and PERSMD (the selected physician). This subform
changes when combo21 is updated.

It works in a pretty neat manner. I guess it's best that I post the applet
on my download site- it's easier to see how things are set up that way. You
can access "Scheduler.zip" by logging onto my Yahoo Briefcase download site
at the following URL: http://f1.pg.briefcase.yahoo.com/bc/alborgmd

If you have any problems with it, just let me know...

Regards,
Al

"K Crofts" wrote in message
...
Hi, i have posted this previously but maybe did not
explain myself well enough to receive any help.
I have a calender control on my form, when a date is
selected on it it puts this date into a text box
(''Date'').
I need to be able to click on a date on the calender and
bring up the relevant record for that date (i thought the
addition of the text box would make coding easier), if no
record exists i need a new one to be created.
Any help at all would be appreciated.
Ta




 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Public Contact birthday and anniversary post to Public Calendar MB Contacts 0 June 10th, 2004 09:05 PM
Can't Post Clarification Al Voss Running & Setting Up Queries 0 May 23rd, 2004 07:43 PM
MAKE QUICK CASH RIGHT NOW!!! 100% LEGAL, INSTRUCTIONS IN THIS POST!! MAKE CASH NOW!!! Setting up and Configuration 0 December 12th, 2003 06:36 PM


All times are GMT +1. The time now is 04:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.