Subform randomly refreshes and shows all records for user

C

Chris

Hi,

I have a main form, that has 2 subforms.

The first subform is used for entering the records.
the properties of this sub form are

Data Entry: yes
Allow Entries: yes
Allow Edits: No
Allow Filters: No
Allow design changes: Design view only.

What is happening is this, The main form, and sub form open just like it's
suppose too. The subform opens to a new record, and the user can enter data,
and save the record.

But what happens is, if the user leaves the db open and needs to work on
something else for a little bit. This subform, will somehow go back and
display all records for that user?

So the record navigator will all of a sudden show record 1 of xx <<however
many they have in the db, it takes them back to record 1.

I don't understand why it does this?
I've never seen this before, and trying everything I can think of to stop it.

Here is the VBA that I have on the subform.
Code:
Private Sub cbo_category_AfterUpdate()
If Not IsNull(Me.cbo_category.Value) Then
cbo_category.DefaultValue = Me.cbo_category.Value
End If
End Sub


Private Sub cbo_system_AfterUpdate()
If Not IsNull(Me.cbo_system.Value) Then
cbo_system.DefaultValue = Me.cbo_system.Value
End If
End Sub


Private Sub Form_AfterUpdate()
Forms!main_entry_FRM![Todays_Activity_FRM].Form.Requery
End Sub
Private Sub cmd_add_Click()
On Error GoTo Err_cmd_add_Click


DoCmd.GoToRecord , , acNewRec

Exit_cmd_add_Click:
Exit Sub

Err_cmd_add_Click:
MsgBox Err.Description
Resume Exit_cmd_add_Click

End Sub

It's driving me insane, it's so random. I had the db open all day
yesterday, and it never did it. But today, after about 20 minutes I noticed
my old records were now displaying.

Hope someone has seen this before, and have a fix. I'm using Access 2003 too.
 
V

vbasean

your sub form is being requeried every time you make record change

Private Sub Form_AfterUpdate()
Forms!main_entry_FRM![Todays_Activity_FRM].Form.Requery
End Sub
 

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