FORM DIED - form based on query no longer opens to correct record

B

BlueWolverine

Hello,
MS ACCESS 2003 on XP PRO.

I have a form that has always worked perfectly that rather suddenly died on
me.

Here's the scenario.

My search results form is tabular, it has rows and columns. Each row has a
button that sends that row's ID to another forms invisible field, so that a
query can read it. THAT QUERY READS THE VALUE PERFECTLY. the button also
then opens my "Detail" form based directly on the query that works perfectly.

The problem is, that instead of the form opening to the ID (or first/only
record in the query) it opens to what I would describe as "Add a new record"
mode. All fields are blank and the autonumber field for ID has (AUTONUMBER)
in the value portion.

This has not happened before. the query works perfectly. something has to
be wrong with the form and I can't find it.

Here is the code that opens the form. note, the ID value goes everywhere it
has to.

f_Edit_Checklist is based on q_Edit_Checklist, q works perfect, but f is
messed up.

************
Private Sub cmd_EDIT_Click()
lookupId = Me.ID.Value
[Forms]![MainMenu].[HoldIDNum] = lookupId
DoCmd.OpenForm "f_Edit_Checklist", acNormal


End Sub
************


Thank you.
 
J

Jeff Boyce

If one of my forms suddenly stops working, I first check the underlying
query that feeds the form (you've done this), then make a backup copy and
try Compact & Repair. If that doesn't do the trick, I fall back to my most
recent backup (prior to the Compact/Repair one) and try copying the form
over and testing.

If that doesn't work, I rebuild the form!

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
B

BlueWolverine

I wanted to add that I had done the Compact and repair and it didn't work but
I tried it again.

No go.

I guess I'll rebuild the form.

I have to say I'm a little irritated with Microsoft that this happens enough
that you have actually developed a strategy to deal wtih it.

I'm still interested in causality if anyone knows.
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


Jeff Boyce said:
If one of my forms suddenly stops working, I first check the underlying
query that feeds the form (you've done this), then make a backup copy and
try Compact & Repair. If that doesn't do the trick, I fall back to my most
recent backup (prior to the Compact/Repair one) and try copying the form
over and testing.

If that doesn't work, I rebuild the form!

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP

BlueWolverine said:
Hello,
MS ACCESS 2003 on XP PRO.

I have a form that has always worked perfectly that rather suddenly died
on
me.

Here's the scenario.

My search results form is tabular, it has rows and columns. Each row has
a
button that sends that row's ID to another forms invisible field, so that
a
query can read it. THAT QUERY READS THE VALUE PERFECTLY. the button also
then opens my "Detail" form based directly on the query that works
perfectly.

The problem is, that instead of the form opening to the ID (or first/only
record in the query) it opens to what I would describe as "Add a new
record"
mode. All fields are blank and the autonumber field for ID has
(AUTONUMBER)
in the value portion.

This has not happened before. the query works perfectly. something has to
be wrong with the form and I can't find it.

Here is the code that opens the form. note, the ID value goes everywhere
it
has to.

f_Edit_Checklist is based on q_Edit_Checklist, q works perfect, but f is
messed up.

************
Private Sub cmd_EDIT_Click()
lookupId = Me.ID.Value
[Forms]![MainMenu].[HoldIDNum] = lookupId
DoCmd.OpenForm "f_Edit_Checklist", acNormal


End Sub
************


Thank you.
 
J

Jeff Boyce

I've also developed a strategy for dealing with aggressive road rage
(others', not my own) ... and I consider it a 'fact of life'.

Besides, if Microsoft created applications that are 100% accurate,
trouble-free, why would you ever buy a new computer or software?<g>

And in all fairness, if a stray cosmic ray strikes my PC's RAM, or the power
line hiccups, or a user kicks out the power cord, is that Microsoft's fault?

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP



BlueWolverine said:
I wanted to add that I had done the Compact and repair and it didn't work
but
I tried it again.

No go.

I guess I'll rebuild the form.

I have to say I'm a little irritated with Microsoft that this happens
enough
that you have actually developed a strategy to deal wtih it.

I'm still interested in causality if anyone knows.
--
BlueWolverine
MSE - Mech. Eng.
Go BLUE!


Jeff Boyce said:
If one of my forms suddenly stops working, I first check the underlying
query that feeds the form (you've done this), then make a backup copy and
try Compact & Repair. If that doesn't do the trick, I fall back to my
most
recent backup (prior to the Compact/Repair one) and try copying the form
over and testing.

If that doesn't work, I rebuild the form!

Good luck

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
Hello,
MS ACCESS 2003 on XP PRO.

I have a form that has always worked perfectly that rather suddenly
died
on
me.

Here's the scenario.

My search results form is tabular, it has rows and columns. Each row
has
a
button that sends that row's ID to another forms invisible field, so
that
a
query can read it. THAT QUERY READS THE VALUE PERFECTLY. the button
also
then opens my "Detail" form based directly on the query that works
perfectly.

The problem is, that instead of the form opening to the ID (or
first/only
record in the query) it opens to what I would describe as "Add a new
record"
mode. All fields are blank and the autonumber field for ID has
(AUTONUMBER)
in the value portion.

This has not happened before. the query works perfectly. something has
to
be wrong with the form and I can't find it.

Here is the code that opens the form. note, the ID value goes
everywhere
it
has to.

f_Edit_Checklist is based on q_Edit_Checklist, q works perfect, but f
is
messed up.

************
Private Sub cmd_EDIT_Click()
lookupId = Me.ID.Value
[Forms]![MainMenu].[HoldIDNum] = lookupId
DoCmd.OpenForm "f_Edit_Checklist", acNormal


End Sub
************


Thank you.
 
L

Linq Adams via AccessMonster.com

I'm confused! You give this code:

Private Sub cmd_EDIT_Click()
lookupId = Me.ID.Value
[Forms]![MainMenu].[HoldIDNum] = lookupId
DoCmd.OpenForm "f_Edit_Checklist", acNormal
End Sub

There is nothing in this code that tells Access to open

f_Edit_Checklist

to a particular field. Is there code in the Form_Open or Form_Load event of
f_Edit_Checklist that references the record you want to open to?
 

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