Link to home
Start Free TrialLog in
Avatar of Fred Fisher
Fred FisherFlag for United States of America

asked on

Unable to get data to display on tab control pages on form

I have a form frmTitles that is all crammed into one page on a form.  I decided to use tab controls to make the form more user friendly.

I created a new form frmTitle2.  I then put the tab control on the form and created two pages Music Title Information (Page 1) and Song Information (Page 2).

I the proceeded to copy all of the controls from frmTitles onto page 1 of frmTitles2 and then the subform subfrmSongs onto page 2 of the tab control.

My problem is that when I open frmTitles2 there is no data. I have compared the Property Sheet for frmTitles and frmTitles2 and they are both the same.  All of the event procedures are there but there is no data.
Avatar of Fabrice Lambert
Fabrice Lambert
Flag of France image

Can you upload your database ?
Did you check the form's data source ?
Are you not seeing data, or are you not seeing the controls?

When you copy controls to a tab control, you must select the tab, and then click on the border which actually defines the page (at least that's the way I describe it).  Once that page is selected, you should be able to paste the copied controls inside the page.  This also applies to your subform control on the 2nd tab.

Dale
Avatar of Fred Fisher

ASKER

I see all of the controls on the proper tab page.  The forms data source (tblTitles) is set properly and exactly the same as the original form.  In the forms Current event I have the following code which worked fine in the original form but does not seem to work in the form with the tab control.

     
     Dim Records As DAO.Recordset
     Dim RecordCount As Long
     Dim SRecordCount As String
     
     With Me
          If RecordsetClone.RecordCount > 0 Then
               .RecordsetClone.MoveLast
          End If
          !txtRecordCount = "Media Title " & .CurrentRecord & " of " & .RecordsetClone.RecordCount
     End With
     
     SRecordCount = DCount("[SongTitle]", "tblSongs")
     txtSongCount = SRecordCount
     
     txtSongCount = FormatNumber(txtSongCount, 0, , , vbTrue)
     
     Call SetStatusFormControls
     Call SetMediaTypeFormControls
     
     If Me.CurrentRecord = 1 Then
          Me.btnPreviousRecord.Enabled = False
          Me.btnFirstRecord.Enabled = False
     Else
          Me.btnPreviousRecord.Enabled = True
          Me.btnFirstRecord.Enabled = True
     End If
     
     If Me.CurrentRecord = Me.RecordsetClone.RecordCount Or Me.NewRecord = True Then
          Me.btnNextRecord.Enabled = False
          Me.btnLastRecord.Enabled = False
     Else
          Me.btnNextRecord.Enabled = True
          Me.btnLastRecord.Enabled = True
     End If
     
     Me!btnCopyRecord.Enabled = Not Me.NewRecord
     Me.btnPrintSongCard.Enabled = False
     

Just to be clear...have you checked that the frmTitle2 has a recordsource ?..just because you copied the controls doesn't mean they carry the recordsource they are bound
Yes, the Property Sheet > Data tab is set to tblTitles.  In the code I listed the txtSongCount shows the proper count but the title count shows 1 0f 0 when it should show 1 of 1905 which put me on to thinking I was setting the RecordsetClone improperly.
Can you upload a sample database with anonymized data ?
ASKER CERTIFIED SOLUTION
Avatar of Fred Fisher
Fred Fisher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial