Will this stump even the best of you?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Okay, this is one of the stranger things I have seen.

I have a simple form with 2 combos and a listbox. The 2nd combo references
the 1st in its Row Source and the listbox references the 2nd query in its Row
Source

Currently, the row source for both the combo and list box are set to actual
saved query objects (not SQL statement).

I use this statement in the criteria of the field in my queries to reference
a field on a form - [Froms]![frmMyForm]![cbo1].

Originally, I copied a couple of combo boxes from another form onto this new
one to save time. I've done this a million times before with no problems. I
simply go into the object and make whatever changes I want to make. Save and
all is well.

When I copied the combo boxes, they contained SQL statements as their
sources, not query objects. They also had the same form-field reference
mentioned above in the field criteria, but to a different form.

Pretty standard. Now the weird thing.

Whenever I open this new form in design mode and make a change and save it,
my [Froms]![frmMyForm]![cbo1] criteria reverts back to what it was in the
original form (the form that I opened and copied the combo and listbox
objects from). This only happens when I make a change and save it.

I have tried all I can think of to solve this - compact, new form, new combo
and list box, copied SQL statement to Notepad and then copied into my new
fields, saved the SQL row source as query objects.

Nothing works. Even now that I have actual Access query objects created and
used as the row source of my combo and listbox, the criteria statement still
reverts back when I make a change and save my form!

Not that this will help, but here is the SQL for my combo and listbox.
frmSAPRoles is the name of the form that I want and frmCurrentlyLoadedCourses
is the old form ref that keeps coming back.

SELECT DISTINCT tblSAPData.[Business Process] FROM tblSAPData WHERE
(((tblSAPData.[Site ID])=Forms![frmCurrentlyLoadedCourses]!cboSiteIDs));

SELECT DISTINCT tblSAPData.[Business Role Name] FROM tblSAPData WHERE
(((tblSAPData.[Business Process])=Forms![frmSAPRoles]!cboBusinessProcesses)
And ((tblSAPData.[Site ID])=Forms![frmSAPRoles]!cboSiteIDs));

Anybody else have this issue?
 
A little more...

I checked the Object Dependencies of my form and it references the form I
used to copy my combo and listbox.

It also refs a query that is related to this original form. I've never seen
this before.

How could simply copying 3 fields from one form to another do this?
 
I figured this out, or at least how to fix the problem, not why it happened.

I am using a template form and it seems that some how the obj dependencies
got crossed with a form. All forms created after this happened had a built in
false dependency.

I deleted my template form and made a new one and then made a new form to
take the place of the one I was having trouble with and all is well in my
world again.

Hope this was at least interesting reading for you all. (:

Clint
 
Back
Top