Selecting record's column in subform

kappa

Registered User.
Local time
Tomorrow, 06:29
Joined
May 11, 2005
Messages
21
Hi All,
What is the easist way to select a column's value in a subform. After the record is selected I would like to write a value ("0") into this column by way of a button click..

Thanks in advance..
 
To get replies on you question, please be more specific of what you mean, e.g. what do you mean with select, in a list box, or what? select a record?
 
Sorry for the vague description, I hope this makes a bit more sense..
I have a subform on a main form with a Master/Child link in place. The subform is being populated from a query.
What I am trying to do is allow the user to click on a record in the subform and select a command button to remove the linked record. I don't want the subform record to be deleted. I am able to do this if I remove the link number from the table on which the subform query is based. The only part I am stuck on is figuring out which record in the subform, the user has selected..
 
Well, if you have a field in the sub form that is unique for each record, for example a primary key, this is simple. Let's say the name of that field is ID. Then you can from the main form use the expression subformcontrol.Form.ID.Value to determine the active record in the sub form.

If you want a command button on each row in the sub form to select that record, then have that command button write the ID to the forms tag: Form.Tag=ID.Value. Then, when you want to get this value from the main form, use subformcontrol.Form.Tag

Hope this helps.
 
Thanks gizzu, this did work, however I came accross a few more issues with the subform and decided to change to a listbox.. Thanks again for the help.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom