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

MDI Forms w/ Code

Status
Not open for further replies.

TMoney216

Programmer
Joined
Mar 1, 2002
Messages
11
Location
US
Hi All,

Fairly new to VB, and I have, what is probably an easy one, a question.

How can I access controls on the main MDI form from a child or document form?


This occurs when I try to update the main MDIForms status bar, from the Add button on my child form...


Private Sub cmdAdd_Click()
On Error GoTo AddErr


frmMain.sbStatusBar.Panels(2).Text = " Adding an Employee...."


adoPrimaryRS.MoveLast
adoPrimaryRS.AddNew
grdDataGrid.SetFocus

Exit Sub
AddErr:
MsgBox Err.Description
End Sub


Thanks!!!!
 
Are you getting an error? If so what does it say. When you referred to your main form did you get intellisense response as you typed it? It looks like it should work... JHall
 
With frmMain.sbStatusBar.Panels(2)
.Text = " Adding an Employee...."
.Refresh ' Refresh the text
End With
' Possibly a DoEvents will be needed but that introduces other problems.

Compare Code (Text)
Generate Sort in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top