Updating a field on a different form

Nero

Shop smart, shop S-Mart
Local time
Today, 17:40
Joined
Jan 8, 2002
Messages
217
Hi,
I have a form in which a user will enter data for a tool and the product that the tool will produce. On another form I have a combo box which contols a subform so that when the user chooses a product from the list the sub from shows all the tools required for the process(a bit like a shopping list).What I am trying to do is if the user wants to use the tools in the list it will activate a yes/no box on my original form for all the tools that are 'In Use'At the moment I am having trouble picking out the records that need the yes/no box updating.
Thanks in advance.
 
I don't quite follow what you are doing...

Is this like a tool inventory?

The first form is what one user might be looking at and if selecting a certain product the tools required are displayed and also shown if available via a checkbox.

The second form is what another user might be looking at and if they choose a tool for their product then the checkbox on the first form is unchecked...

Am I on track here?

Mitch
 
Hi Mitch,
Basically the first form is like an inventory that will amongst other things show the status for a selected tool.
On the second form a user chooses a product from a combo box and on a subform displays all the tools required to make the product.What I am trying to do is if a user decides they want to make the selected product they click a button which will set the status of the tools on the first form as in use.
If the user then scrolls through the records on the first form they will see the status of the tools.ie In use or Ready for use etc.
 
Mitch,
I have written the code below to try and solve my problem but it is not working.It is updating all the records in the table and not the ones specified by 'Holder'.
I think need the If statement inside the loop but I keep getting errors when I do this.
I would be very grateful for any pointers -

Sub Update_Click()
Dim Db As Database
Dim rst As Recordset
Dim Holder

Holder = Me.Products 'Name of product
Set Db = CurrentDb
Set rst = Db.OpenRecordset("Tooling", dbOpenDynaset)

rst.MoveFirst

If rst("ProductID") = Holder Then
Do
rst("InUse") = True
rst.Update
rst.MoveNext
Loop Until rst.EOF = True
rst.Close
End If


Set Db = Nothing
Set rst = Nothing


End Sub




[This message has been edited by Nero (edited 03-21-2002).]
 
Problem Solved.
Thanks anyway.
 

Users who are viewing this thread

Back
Top Bottom