Form keeps opening as new record instead of current record (1 Viewer)

lunaj5

New member
Local time
Yesterday, 22:21
Joined
Jul 16, 2019
Messages
3
I have a a few forms that open into another called CAPA. Whether I use a macro or VBA for a button to open the CAPA form, it opens as a new record instead of the one I want. I have an ID that I am using for the where condition. Even if I open the from from the objects panel on the left, it opens as a new form, so I figure that the issue is with the form itself and not the buttons. I have it set to filter on load (I've tried using it on and off) and I've toggled data entry.

Any ideas?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:21
Joined
Oct 29, 2018
Messages
21,358
Hi. Data Entry should be set to "No" then, check the Load, Open, Current, and Activate events for any code.
 

lunaj5

New member
Local time
Yesterday, 22:21
Joined
Jul 16, 2019
Messages
3
I set it to no. I do have code for On Load, but all it does is set the visibility of some labels and reads check boxes to set text boxes.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:21
Joined
May 7, 2009
Messages
19,169
is the form bound or are the conteols bound?
 

JHB

Have been here a while
Local time
Today, 06:21
Joined
Jun 17, 2012
Messages
7,732
Are you sure the filter you build return any records?
Show all the code you've in the OnLoad event.
If you can't get it post your database with some sample data, zit it.
 

lunaj5

New member
Local time
Yesterday, 22:21
Joined
Jul 16, 2019
Messages
3
All of the fields come from a table, so it is bound.

The OnLoad is

Code:
Private Sub Form_Load()
If (Me.Internal_C = True) Then
Me.CE_label.Visible = False
Me.CI_label.Visible = True
Me.Type = "Internal"

ElseIf (Me.Internal_C = False) Then
Me.CE_label.Visible = True
Me.CI_label.Visible = False
Me.Type = "External"

Else
Me.CE_label.Visible = False
Me.CE_label.Visible = False
Me.Type = Null

End If

If Me.Open = True Then
Me.Status = "Open"

ElseIf Me.Closed = True Then
Me.Status = "Closed"

ElseIf Me.Pending_E = True Then
Me.Status = "Pending"

Else
Me.Status = Null
End If

End Sub
 

JHB

Have been here a while
Local time
Today, 06:21
Joined
Jun 17, 2012
Messages
7,732
It isn't anything in your code that should make your form open at a new record.
Could you post your database with some sample data, zip it?
 

Users who are viewing this thread

Top Bottom