How to reference one form to another form

majette97

Registered User.
Local time
Today, 08:39
Joined
Apr 26, 2001
Messages
23
How to point Me to subform? OR How to reference one form to another form. (Isn't this one in the same or is there more than one way to reference?) See my code below:
(The values for the days of the week are not displaying on the subform.)

Private Sub WeekNo_AfterUpdate()
Dim rs As Object
Dim rs2 As Object
Dim strSql As String

strSql = "select * from timecard where WeekNo = #" & WeekNo.Text & "#"
Set rs = CurrentDb.OpenRecordset(strSql)

strSql = "select * from subtimecard where TimeNo = " & rs.Fields("TimeNo").Value
Set rs2 = CurrentDb.OpenRecordset(strSql)

Forms!change_timecard!change_timecard_sub.Form!Controls.txtAppName = AName (Doesn't work)
Me![txtTaskName] = TName
Me![Monday] = rs2![MON]
Me![Tuesday] = rs2![TUE]
Me![Wednesday] = rs2![WED]
Me![Thursday] = rs2![THU]
Me![Friday] = rs2![FRI]

rs.Close
rs2.Close
End Sub

Need help ASAP!
Thanks for any assistance!


[This message has been edited by majette97 (edited 06-25-2001).]
 
To refer to YourControl on subform YourSubform of main form YourMainForm:

Forms![YourMainForm]![YourSubform]![YourControl]

HTH
Chris
 

Users who are viewing this thread

Back
Top Bottom