Recordsource - display problem

M

Martin Dashper

I have a bound form which, when the Record Source is hardwired on the
data tab of the form's properties, will display all appropriate
records. However, if I set the Record Source in code eg.
(Me.RecordSource = "myTable"), it only displays the first record.

Any Suggestions?

Martin Dashper
 
A

Allen Browne

Martin, is this form a subform?

If so, you may need to also programmatically clear the subform control's
LinkMasterFields and LinkChildFields properties. When you assign the
RecordSource, Access has a guess and sets these to whatever it feels like.
 
M

Martin Dashper

No, it is not a subform, it is a form created by the form wizard (in a
tabular layout) and is opened from another form using
DoCmd.OpenForm.....

Martin
 
M

Martin Dashper

I've tried in both 'On Open' and 'On Load'

Dim tableName As String
tableName = "tblDaySheet_Martin2"
Me.RecordSource = tableName

I have also tried the above using the table's name directly without
the intervening variable.

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top