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

Form recordset issue

Status
Not open for further replies.

MDTekUser

Technical User
Dec 25, 2005
68
US
I have a subform that is read only. I am trying to bind labels to the recordset. It works fine when I initially load the subform, but when I navigate to another record on the main form I get an error "no current record". Does anyone have a clue what is wrong here. I posted the subform code below. Thanks.

Code:
Dim rs As DAO.Recordset
Private Sub Form_Current()

    Set rs = Me.Recordset
    
    Me.Monday.Caption = Nz(rs!Monday, 0)
    Me.Total_Hours.Caption = Nz(rs![Total Hours], 0)
    Me.Tuesday.Caption = Nz(rs!Tuesday, 0)
    Me.Wednesday.Caption = Nz(rs!Wednesday, 0)
    Me.Thursday.Caption = Nz(rs!Thursday, 0)
    Me.Friday.Caption = Nz(rs!Friday, 0)
    Me.Saturday.Caption = Nz(rs!Saturday, 0)
    Me.Sunday.Caption = Nz(rs!Sunday, 0)
   
End Sub
 
I put in an rs.MoveLast before I load the label controls and now it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top