Form doesn't display source records

C

Claudette Hennessy

What's happing here?
I have a form that is sourced from a table. When it is opened, it does not
display the records in form or datasheet view. When I look at the property
sheet in design view, the source table is highlighted, as though it were
selected. If I reassign the source table, and return to form view, all the
records are displayed. If I return to the form after closing it, once
again, no records are displayed.

I have a field on the form, which when clicked, opens another form with
history information and closes it after an interval by the following code:

Private Sub txtShopname_Click()
If CurrentProject.AllForms("frmDealerHistory").IsLoaded = True Then
Forms!frmDealerHistory.Requery
Else
DoCmd.OpenForm "frmDealerHistory"
End If
'Reset the Timer to display another 5 seconds
Forms!frmDealerHistory.TimerInterval = 5000
End Sub


Private Sub cmdRefresh_Click() ! Code to Refresh form for calculations
after entering data
On Error GoTo Err_cmdRefresh_Click


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_cmdRefresh_Click:
Exit Sub

Err_cmdRefresh_Click:
MsgBox Err.Description
Resume Exit_cmdRefresh_Click

End Sub
Thank you for help,
Claudette
 
S

Stavi

What's happing here?
I have a form that is sourced from a table. When it is opened, it does not
display the records in form or datasheet view. When I look at the property
sheet in design view, the source table is highlighted, as though it were
selected. If I reassign the source table, and return to form view, all the
records are displayed. If I return to the form after closing it, once
again, no records are displayed.

I have a field on the form, which when clicked, opens another form with
history information and closes it after an interval by the following code:

Private Sub txtShopname_Click()
If CurrentProject.AllForms("frmDealerHistory").IsLoaded = True Then
Forms!frmDealerHistory.Requery
Else
DoCmd.OpenForm "frmDealerHistory"
End If
'Reset the Timer to display another 5 seconds
Forms!frmDealerHistory.TimerInterval = 5000
End Sub

Private Sub cmdRefresh_Click() ! Code to Refresh form for calculations
after entering data
On Error GoTo Err_cmdRefresh_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_cmdRefresh_Click:
Exit Sub

Err_cmdRefresh_Click:
MsgBox Err.Description
Resume Exit_cmdRefresh_Click

End Sub
Thank you for help,
Claudette

I had same problem today, eventually I found out that my form was
being opened via a button macro in "Add" mode, I changed it to "Edit"
and my records are now displayed when I open my form.
 

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