Records not appearing on subform

303factory

Registered User.
Local time
Today, 14:07
Joined
Oct 10, 2008
Messages
136
Hi all

I'm very confused as to why my continuous subform displays no data even though I know it should be.

If I do a record count of my SQL string:

Code:
Dim rs As New ADODB.Recordset

strSQL = "SELECT * FROM tblContacts WHERE UniqueRef = " & gUniqueRef & _
    " AND DataSet =1 " & _
    " AND ContactType = " & Chr(39) & "MSISDN" & Chr(39)
    
    rs.Open strSQL, gSQLdbase, adOpenKeyset, adLockOptimistic, adCmdText
    
    MsgBox (rs.RecordCount)
    rs.Close
    Set rs = Nothing
It returns a recordcount of 11.
Yet if I set my subform to have the recordsource as the same SQL string in the form_open function (which is triggering succesfully in debug)

Code:
Me.RecordSource = "SELECT * FROM tblContacts WHERE UniqueRef = " & gUniqueRef & _
    " AND DataSet =1 " & _
    " AND ContactType = " & Chr(39) & "MSISDN" & Chr(39)
Then my form has no entries other than the default empty entry. If I type new enties into the form they add successfully to the table and are visible on the form, but dissapear when you refresh the form (although they remain in the table)

Can anyone think of any reason this might be happening? The subform just has 5 text and check boxes that are all bound to the table.. im most perplexed

303
 
Have a look at the Filter property of your form. Also try adding a Me.FilterOn = False on the On Load event or a Docmd.ShowAllRecords method on the On Open event.
 
Have a look at the Filter property of your form. Also try adding a Me.FilterOn = False on the On Load event or a Docmd.ShowAllRecords method on the On Open event.

I think my database got corrupted... after following your suggestions my client broke in spectacular new ways

I deleted my subform and rebuilt it from scratch and it seems to work now, thanks for your help

D
 

Users who are viewing this thread

Back
Top Bottom