If I wanted to open an access form and have its recordset based on a value on my current form Option

M

mgworek

Would I set a string that stays in memory on the click event and then
base the recordset on that string on the new form?

I have a form that opens in continuous mode. It shows all tickets
assigned to a tech. I want the tech to be able to click on one of the
tickets and a different form opens up based on the ticket he clicked
on.


at first i thought i could base the value using something like Forms!
MyForm.FieldName but since I have the form opening up in Continuous
mode, i didn't think that would work.


Thank you and hope that makes sense.
 
L

Larry Linson

mgworek said:
Would I set a string that stays in memory on the click event and then
base the recordset on that string on the new form?

I have a form that opens in continuous mode. It shows all tickets
assigned to a tech. I want the tech to be able to click on one of the
tickets and a different form opens up based on the ticket he clicked
on.


at first i thought i could base the value using something like Forms!
MyForm.FieldName but since I have the form opening up in Continuous
mode, i didn't think that would work.

Why not?

In Continuous View, there's still just one Record that has the Focus, and it
is the value for the Record with the Focus that is returned when you address
that Control in your VBA code. In fact, for Tables of
something-less-than-huge size, using a continuous-forms-view Form and
clicking or double-clicking to select is a very common practice.

Here's code copied from a test database I use, in the Double-Click event of
the Control "EmployeeID" which displays the Field "EmployeeID" in an
"EmployeesList" form, that opens the detail form "Employees" to the same
Record. In that particular instance, I want to be able to double-click on
any of the displayed Fields of the Record with the Focus, so have this same
code in the Double-Click event of each of the Controls.

DoCmd.OpenForm "Employees", , , "[EmployeeID] = " & Me.EmployeeID

Larry Linson
Microsoft Access MVP
 
M

mgworek

Would I set a string that stays in memory on the click event and then
base the recordset on that string on the new form?
I have a form that opens in continuous mode. It shows all tickets
assigned to a tech. I want the tech to be able to click on one of the
tickets and a different form opens up based on the ticket he clicked
on.
at first i thought i could base the value using something like Forms!
MyForm.FieldName but since I have the form opening up in Continuous
mode, i didn't think that would work.

Why not?

In Continuous View, there's still just one Record that has the Focus, and it
is the value for the Record with the Focus that is returned when you address
that Control in your VBA code. In fact, for Tables of
something-less-than-huge size, using a continuous-forms-view Form and
clicking or double-clicking to select is a very common practice.

Here's code copied from a test database I use, in the Double-Click event of
the Control "EmployeeID" which displays the Field "EmployeeID" in an
"EmployeesList" form, that opens the detail form "Employees" to the same
Record. In that particular instance, I want to be able to double-click on
any of the displayed Fields of the Record with the Focus, so have this same
code in the Double-Click event of each of the Controls.

DoCmd.OpenForm "Employees", , , "[EmployeeID] = " & Me.EmployeeID

Larry Linson
Microsoft Access MVP

nevermind, got it working.
 
Top