TextBox value that apply to all

?

.

hi currently i have a text box and a subform. I want the user to end a
value into the text box and it will automatically fill up the result in
the sub form with the value. But currently it only does it for the
first record.
 
J

Jeff L

Run an update query in the After Update event of the textbox.

Docmd.RunSql "Update YourTableName " & _
"Set YourField = '" & Me.TextboxName & "' " & _
"Where ID = " & Me.IDFieldName

Hope that helps!
 
?

.

Hi

for the Where ID = " & Me.IDFieldName that part what should i put? the
Primary Key? cos i can't seems to link it to the subform data.
 
J

Jeff L

I am assuming that in your subform you are only showing data that's
related to the current record of your main form. You must have done
something to accomplish that. You need to put something in the Update
query that identifies what rows you are going to update. Otherwise you
are going to update every rown in the table with the same value and I'm
sure that's not what you are wanting to do. In the Where clause that I
wrote, I was assuming that you had some sort of unique ID (probably the
primary key)that you could use for updating the proper number of rows.
If that is not the case, let me know what you are doing and then we can
try and find a different solution.
 
?

.

Hi,

The current situation is that i have a subform that have a query that
select all the record in the database with the value and display it
out.

The subform have a checkbox for every record. For those that is checked
i would like to update the value in the database with the value in the
textbox.

Thus I have implemented a button to save all changes but the thing is
that it only save for the first record but not the rest.

Thanks :p
 
Top