MANY problems with subform in tab; want to add new record (adp/SQL)!?!?!

B

bobg.rjservices

running access 2k; adp w/ linked tables to SQL server;

I am absolutely stymied, and ticked off beyond belief - I can not
believe how much time I've wasted trying to do something that should be
comically easy!!!!!

I have 2 tables: T_people, T_calls in a 1 to many relation (many
calls to each person).

I have a form with tabs in it. the form is NOT attached to a record
source. The first tab is filled with UNBOUND fields relating to
T_people. The fields are unbound with no recordsource, because I don't
want users to "browse" the records. They must enter an exact ID#, to
pull up a record. THIS WORKS JUST FINE (obviously, I have code that
does the lookup).

The 2nd tab contains a sub-form which should show only calls related to
the selected person in tab 1.

This sub-form has T_calls as its record source, and filtered by
person_id.
If I open this sub-form ALONE, I have no problem adding records. the >*
nav button is available, and works. As soon as I open the main form
with tabs, and goto this sub-form, the >* nav button is greyed out. I
added a button to this subform "add new call", with code that does a
"DoCmd.GoToRecord".

This button/code fails miserably, and I have tried EVERYTHING I can
think of and MANY permutations on stuff I've read about in this group,
with no success what-so-ever.

I can't just do a simple DoCmd.GoToRecord, because the "object isn't
open".
I can't setfocus on the dam object, because I can't seem to find it in
ANY collection!?!?!?

Forms("MainForm!SubForm").SetFocus (and all the syntactical
variations) DOES NOT work; apparently because I need to address the
tab. I can't figure out how to setfocus to the sub-form under the tab
in order to do a GoToRecord.

AND - I'm not even sure that once I do this, if the ----'g GoToRecord
will even work!!!!!!

Why the blazes is something that seems so easy, so freaking hard????


any help appreciated...
TIA
 
S

salad

running access 2k; adp w/ linked tables to SQL server;

I am absolutely stymied, and ticked off beyond belief - I can not
believe how much time I've wasted trying to do something that should be
comically easy!!!!!

I have 2 tables: T_people, T_calls in a 1 to many relation (many
calls to each person).

I have a form with tabs in it. the form is NOT attached to a record
source. The first tab is filled with UNBOUND fields relating to
T_people. The fields are unbound with no recordsource, because I don't
want users to "browse" the records. They must enter an exact ID#, to
pull up a record. THIS WORKS JUST FINE (obviously, I have code that
does the lookup).

The 2nd tab contains a sub-form which should show only calls related to
the selected person in tab 1.

This sub-form has T_calls as its record source, and filtered by
person_id.
If I open this sub-form ALONE, I have no problem adding records. the >*
nav button is available, and works. As soon as I open the main form
with tabs, and goto this sub-form, the >* nav button is greyed out. I
added a button to this subform "add new call", with code that does a
"DoCmd.GoToRecord".

This button/code fails miserably, and I have tried EVERYTHING I can
think of and MANY permutations on stuff I've read about in this group,
with no success what-so-ever.

I can't just do a simple DoCmd.GoToRecord, because the "object isn't
open".
I can't setfocus on the dam object, because I can't seem to find it in
ANY collection!?!?!?

Forms("MainForm!SubForm").SetFocus (and all the syntactical
variations) DOES NOT work; apparently because I need to address the
tab. I can't figure out how to setfocus to the sub-form under the tab
in order to do a GoToRecord.

AND - I'm not even sure that once I do this, if the ----'g GoToRecord
will even work!!!!!!

Why the blazes is something that seems so easy, so freaking hard????


any help appreciated...
TIA
See if this reference helps....
http://groups.google.com/group/micr...+group:*access*&rnum=5&hl=en#2b222879d4a7e476

How are you linking the two subforms together? Are you using
Filter/FilterOn?

Have you considered scapping tabbed pages? For example, in the main
form open a form/subform with the linking done for you? IOW, search for
your person then open a form with person data and the calls below?
 
G

Guest

A subform is just that, a form based on records related to another form which
is based on records, and unless the records each are based on have a common
identifier ie. your one-to-many-relationship, YOU WILL GET NO relationship.

I think that having you main form unbound is a problem. There are ways to
filter the main form to restrict the users the way you want, but right now
your subform is not a sub to anything.
 
B

bobg.rjservices

OK -
update:

TX for the reply; I did finally access my tabs correctly. BUT - here's
the REALLY WEIRD part:

after I finally was able to do the setfocus I thought I needed -
everything just started working!?!?!

I've now deleted the "add new record" button, and ALL code from the
sub-form, AND the >* nav button now works!?!?!?!?!?!

I have absolutely no idea what the F'g problem was - I have changed
NOTHING of the core functionality. It wasn't working 1st thing this
morning, and after I figured out an alternate approach, I no longer
need the alternate approach!?!?!?!?!

I really hate this kind of crap.
 
S

salad

OK -
update:

TX for the reply; I did finally access my tabs correctly. BUT - here's
the REALLY WEIRD part:

after I finally was able to do the setfocus I thought I needed -
everything just started working!?!?!

I've now deleted the "add new record" button, and ALL code from the
sub-form, AND the >* nav button now works!?!?!?!?!?!

I have absolutely no idea what the F'g problem was - I have changed
NOTHING of the core functionality. It wasn't working 1st thing this
morning, and after I figured out an alternate approach, I no longer
need the alternate approach!?!?!?!?!

I really hate this kind of crap.

Your computer hates you. It thought, "let me screw around with Bob".
To teach it a lesson, unplug its power cord. You'll feel better.
 
B

bobg.rjservices

I think that's an OK idea -
I have a better one that involves a sledge hammer......
maybe a slow, painful virus or two.....

I discovered the reason (I think :)- turns out someone added a BOUND
field to the sub-form that was bound to a field that no longer exists,
AND this field was hidden behind another object!!!!!!

where's my solve-any-problem device at???? (that would be the
sledgehammer - which, by the way, actually sits on top of my desk 24/7
- today is probably a day someone should take it away from me
before.... ;-)
 
B

bobg.rjservices

Your point is well taken, Jeff;

however, although there is no recordsource bound to the main form, the
sub-form IS bound (parent/child, form/subform) to the field that
accepts the entry of the person's ID #. After someone enter's an ID#,
and clicks the lookup button, all of the unbound fields in the main
form are populated (these are all read-only). Then, when they click the
2nd tab (for viewing / adding call's), it's tied to the field with the
person's ID#.

The sub-form in the 2nd tab, is a standard run-of-the-mill form. people
can scroll thru the various calls associated with the selected ID (and
add new calls).

So, there isn't a "formal" relationship in this form/group, but they
are related. Formal relationship's are used just about everywhere
else...

part of this app is legacy, so I'm not 100% sure on all the reason's
why things were done this way; except that I know there wasn't to be
ANY chance that a user would pull up a record unless they had the
correct ID# (ID#'s are random, algorithm generated, so the chance of
inputing an incorrect ID#, and finding a record is almost impossible).

TX for your input!
-Bob
 

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