Form to Form (1 Viewer)

CanWest

Registered User.
Local time
Yesterday, 23:20
Joined
Sep 15, 2006
Messages
272
Hello everyone

I am having a complete brain fart today and would really appreciate some guidance. Here is the scenario. I am trying to take the value of a field in one for to another form that is open. The form the value is coming from is continuous but only one of the items is current based on a checkbox

I have tried this but it does not take into account the checkbox

Code:
Forms!frmMain!frmClients.Form!CurrentCDC = Form!pfrmClientCDCHistory!Coordinator

ANy assistance will be greatly appreciated
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 15:20
Joined
Jan 20, 2009
Messages
12,853
A Continuous Form has only one "Current Record", the one that the cursor is on, regardless of what you have checked. You can only refer to this record on the form.

So you would need to first move the cursor to the record that is checked if you want to refer to it. Alternatively, you could read the record with the check directly from the underlying table using DLookup.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:20
Joined
May 7, 2009
Messages
19,247
from which event are you setting the value?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 06:20
Joined
Sep 12, 2006
Messages
15,660
you could also save the field value of the current record in the continuous form, and then read the value from the variable, without needing to refer to the continuous form directly.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 15:20
Joined
Jan 20, 2009
Messages
12,853
What would be the point of doing that Dave?
 

CanWest

Registered User.
Local time
Yesterday, 23:20
Joined
Sep 15, 2006
Messages
272
A Continuous Form has only one "Current Record", the one that the cursor is on, regardless of what you have checked. You can only refer to this record on the form.

So you would need to first move the cursor to the record that is checked if you want to refer to it. Alternatively, you could read the record with the check directly from the underlying table using DLookup.

Is there not a way to capture the value in the record that has the check box ticked based on some kind of where statement. I can't us Dlookup on the underlying table because there are many records that have the checkbox checked. In the form there is only one
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 06:20
Joined
Jul 9, 2003
Messages
16,287
You could make your form paginated so that you have complete control over the records displayed. then you would know where the check box was in regard to the underlying data.You would be able to find it like that with SQL statements and VBA...

Sent from my SM-G925F using Tapatalk
 

CanWest

Registered User.
Local time
Yesterday, 23:20
Joined
Sep 15, 2006
Messages
272
Here's a thought. I just discovered that by doing ...

Code:
     docmd.gotorecord ,,acFirst

I can pick up the value in the first record. So here is what I am thinking. How do I use docmd.gotorecord to go to the record with the check box checked. That will work perfectly
 

MarkK

bit cruncher
Local time
Yesterday, 22:20
Joined
Mar 17, 2004
Messages
8,186
If your continuous subform is not showing all records from the table, that is because a filter has been applied by the LinkMasterFields and LinkChildFields properties of the subform control, and those criteria are not hard to find.

What I would do in your situation is use a DLookup() or open a recordset directly on the table, applying the filters that are applied to your subform--as noted above--AND filtering for the checked field. Then read the value you need from that record.

I would always avoid relying on data presented in the user interface as a data source for critical operations. For reliability and scalability, make your 'behind the scenes' data processing independent of your UI.

Hope this helps,
 

CanWest

Registered User.
Local time
Yesterday, 23:20
Joined
Sep 15, 2006
Messages
272
If your continuous subform is not showing all records from the table, that is because a filter has been applied by the LinkMasterFields and LinkChildFields properties of the subform control, and those criteria are not hard to find.

What I would do in your situation is use a DLookup() or open a recordset directly on the table, applying the filters that are applied to your subform--as noted above--AND filtering for the checked field. Then read the value you need from that record.

I would always avoid relying on data presented in the user interface as a data source for critical operations. For reliability and scalability, make your 'behind the scenes' data processing independent of your UI.

Hope this helps,

I am afraid this is way over my head. I don't know how to do this. I have some knowledge on how to get data from an open form but what you are suggesting is way above what I know how to do.

Can you point me in the right dirrection
 

MarkK

bit cruncher
Local time
Yesterday, 22:20
Joined
Mar 17, 2004
Messages
8,186
Can you point me in the right dirrection
I think you need to tell us at this point what is the "right" direction for you.

Obviously the easiest way to do something leverages what you already know, so if a suggestion you receive looks really hard to you, maybe it's not the best choice for you, even if it may be the consensus "best practice."

So how much learning do you want to do, and how much do you already know? IMO, the "right" direction for you will be a function of those things.
 

Users who are viewing this thread

Top Bottom