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

Form Position - Driving me nuts!

Status
Not open for further replies.

sucoyant

IS-IT--Management
Sep 21, 2002
213
US
Good day all!

Ugh.. I'm going insane trying to figure this out.
All I need to do is open a second form where the user right clicks in a base form.

By base form looks like this (Warning: Still in development):
form.gif


The second form really is nothing more than a button at this point, but this is what happens when I right click on the treeview:

position.gif


Argh! This darn thing will not open in the correct area! What am I doing wrong?

This is the code I'm using to open the second form (New Record button) from the treeview in the base form:

Code:
Private Sub TreeView1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)

If Button = vbKeyRButton Then
    DoCmd.OpenForm "rightMenu", acNormal, , , , , x & "|" & y
End If

End Sub


Here is the code to position the second form:

Code:
Private Sub Form_Open(Cancel As Integer)
Dim intPos As Integer 'Position of the Pipe
Dim screenXPosition As Long
Dim screenYPosition As Long

intPos = InStr(Me.OpenArgs, "|")

If intPos > 0 Then
  screenXPosition = Left$(Me.OpenArgs, intPos - 1)
  screenYPosition = Mid$(Me.OpenArgs, intPos + 1)
End If

Me.Move screenXPosition, screenYPosition

End Sub


Could someone offer some help? I'm about to snap! lol

Thanks in advance!

________________________________________
BUDDHA.gif
Buddha. Dharma. Sangha.
 
I think I may have mislead you Chance1234, I need to have the second form (which only contains the "New Record") button to show up where you click in the first form.

________________________________________
BUDDHA.gif
Buddha. Dharma. Sangha.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top