Form doesn't show any records.

Y

Yepp

I have a form that doesn't show all my records when I open it. For example,
I open Access and then open the database. I click on my form to open it, and
it shows no records. I know for a fact that there are several records
entered into the database via my form, but the only way I can see them is to
open the actual table to which my form is linked.

Is there something I need to do to correct this problem that will allow me
to see every record entered using my form? Thanks.
 
G

George Nicholson

Sounds like the DataEntry property of the form is set to Yes. Change it to
No.

DataEntry = Yes means the form's *only purpose* is heads-down data entry so
it should always show a new (blank) record.
DataEntry = No will still allow DataEntry, but you have the choice of
looking at (and modifying) old records or creating new ones.
 
Y

Yepp

Ok. I changed the DataEntry = No, but the problem now is when I exit the
form and open it back up. The problem is still the same: the form only shows
the new record and not the ones already entered. How can I fix this problem
for good?
 
R

Rick Brandt

Yepp said:
Ok. I changed the DataEntry = No, but the problem now is when I exit
the form and open it back up. The problem is still the same: the
form only shows the new record and not the ones already entered. How
can I fix this problem for good?

Are you opening the form from code or macro? The OpenForm command can also
specify that the form be opened in DataEntry mode by using the acAdd argument.
If you see that remove it.
 
Y

Yepp

I am just opening it manually (i.e., not via code or macro). That is what
makes no sense.
The form autofills some fields...could that be an issue why this keeps
happening?
 
R

Rick Brandt

Yepp said:
I am just opening it manually (i.e., not via code or macro). That is
what makes no sense.
The form autofills some fields...could that be an issue why this keeps
happening?

Autofills some fields how? With code or macro? If so then post the code or
macro steps.
 
G

George Nicholson

Ok. I changed the DataEntry = No, but the problem now is when I exit the
form and open it back up. ....
How can I fix this problem for good?


Clarification, please. So, with that change, it works right once, but
reverts to 'old' behaviour after that?

In design view, set DataEntry to No *and save the form*. Then open it in
form view.

What happens?

Close & reopen form

What happens?
 
Y

Yepp

I opened the form in design view and set DataEntry to No; I then saved the
form and switched to form view. It works normally (i.e., I can see all
records that have been entered) while I am in the form. Once I exit the form
and then open it back up, it reverts back to showing only a new record. When
I look at the properties of the form in design view, the DataEntry is still
set to No...but still I see no records.
 
Y

Yepp

Here is the code that autofills some of the fields on the form...is there
code I can add to make DataEntry stay set equal to No?

Private Sub txtPender_Number_AfterUpdate()
Dim strSQL As String
Dim rs As DAO.Recordset
strSQL = "SELECT [prv1].LAST_NAME, [prv1].FIRST_NAME, [prv1].ADDRESS_LINE_1,
[prv1].ADDRESS_LINE_2, [prv1].CITY, [prv1].STATE, [prv1].ZIP_CODE,
[prv1].PHONE_NUMBER FROM [prv1] WHERE " & _
"[prv1].SEQ_PROV_ID=" & Me. Pender_Number
Set rs = CurrentDb.OpenRecordset(strSQL)
rs.MoveLast
rs.MoveFirst
If rs.RecordCount > 0 Then
Me.txtPender_Last_Name = rs.Fields![LAST_NAME]
Me.txtPender_First_Name = rs.Fields![FIRST_NAME]
Me.txtPender_Address = rs.Fields![ADDRESS_LINE_1]
Me.txtPender_Address2 = rs.Fields![ADDRESS_LINE_2]
Me.txtPender_City = rs.Fields![CITY]
Me.txtPender_State = rs.Fields![STATE]
Me.txtPender_Zip = rs.Fields![ZIP_CODE]
Me.txtPender_Phone = rs.Fields![PHONE_NUMBER]

End If
rs.Close
Set rs = Nothing
End Sub
 
Top