 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 23rd, 2007, 09:02 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
dartcoach,
The 'frmCalendar' is an actual form which contains an "Active X calendar 11.0" control on it.
Rob,
I'll try that too.
|
|

April 23rd, 2007, 09:09 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Grafixx,
Give it a whirl and please ask if you get stuck. It can be strange working with form instances in VBA for the first few times, but once you get your head round it, you can save yourself a lot of time!
HTH.
Regards,
Rob
|
|

April 23rd, 2007, 09:26 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
rob,
I cut and pasted your code into the 'Insert Date' command button on the 'frmTask' (Main Form). Then I cut and pasted the code in the 'on click' of the 'frmCalendar'-'Insert Date' command button.
The code on the 'Insert Date' of the 'frmCalendar' returned this error:
'Compile Error: Invalid Attribute in Sub or Function' (Highlighted is the 'Private Sub cmdInsertDate_Click()'
I don't know if I have to change this to specify the which 'date' control on the 'frmTask' I want it to populate?
|
|

April 23rd, 2007, 09:33 AM
|
|
Friend of Wrox
|
|
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Bryan,
Rob is correct. Utilizing Global Variales can cause problems if you don't pay attention to what you're doing. If you can get his code to work, I highly recommend it.
Kevin
dartcoach
|
|

April 23rd, 2007, 09:35 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Grafixx,
The cmdInserDate_Click() sub should look like this:
Code:
Private Sub cmdInsertDate_Click()
PopulateWithDate TextBoxName
End Sub
Make sure the PopulateWithDate Sub is pasted into a Global Module.
Did that help?
Rob
|
|

April 23rd, 2007, 09:37 AM
|
|
Friend of Wrox
|
|
Join Date: Mar 2007
Posts: 432
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Quote:
quote:Originally posted by dartcoach
Bryan,
Rob is correct. Utilizing Global Variales can cause problems if you don't pay attention to what you're doing. If you can get his code to work, I highly recommend it.
Kevin
dartcoach
|
Thanks dartcoach for the recommendation!
Kind Regards,
Rob
|
|

April 24th, 2007, 11:28 AM
|
|
Authorized User
|
|
Join Date: Apr 2007
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks dartcoach for the help with the db isssue. Much much much appreciated.!
|
|
 |