By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Positioning a pop-up Calendar

P: n/a

I have a continuous form with a date field in it. beside the date
field, i've made a command button that when pressed, displays a
calendar form which allows users to choose a date, once a date is
chosen, the calendar form closes and the value chosen gets transfered
into the date field.

I want to make it so that the calendar form always appears next to
button when pressed, right now it just pops up in the middle of the
screen each time. I'm not sure if there's some sort of way to write
VB code that can read the position of the button that's just been
pressed and then relay that information to the calendar form and use
it to set it's position?! I know you can move forms with
docmd.movesize but i
can't get it to move to the button when pressed. if anyone out there
has any
suggestions on how to do this i'd greatly appreciate it! thanks.
Mar 19 '08 #1
Share this Question
Share on Google+
1 Reply

P: n/a

Try this:

Let's suppose that you command button name is Command1
and the calendar form name is frm_Calendar:

Private Sub Command1_Click()
Dim lL, lT As Long
lL = Me.WindowLeft + Me.Command1.Left + Me.Command1.Width + 345
lT = Me.WindowTop + Me.Command1.Top + Me.Command1.Height - 200
Forms("frm_Calendar").Move lL, lT
End Sub
Mar 20 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.