I have table1 and table2
In table1 I have
stID (PK)
Name
dateOfBirth
schoolId
in table2 I have
serviceId(PK)
serviceType
stId
the two tables are related using the stID key
stID is numerical field starting 100 and I have about 200 records in the first table
Now, Single data entry for one person is working fine using a single form
I just type stID and the service type value.
Now what I want is that once I enter the service value for one person let say stID 145 then I also want the service type value to enter for the rest 199 individuals automatically
Is it possible ???
Thanks in advance
|
Go4Expert Member
|
|
| 18Aug2011,21:00 | #2 |
|
Copy and Paste the following Code into the Form Module with appropriate changes to refer the Controls correctly:
Code:
Private Sub ServiceType_DblClick(Cancel As Integer)
Dim getval, rst As Recordset, bkmark As String
Dim bkmksave As String
Me.Refresh
bkmksave = Me.Bookmark
getval = Nz(Me![ServiceType], 0)
If getval = 0 Then
Exit Sub
End If
Set rst = Me.RecordsetClone
rst.MoveFirst
Do While Not rst.EOF
rst.Edit
rst![ServiceType] = getval
rst.Update
bkmark = rst.Bookmark
Me.Bookmark = bkmark
rst.MoveNext
Loop
rst.Close
Me.Bookmark = bkmksave
Set rst = Nothing
End Sub
You can see the changes happening on all the records one by one. |
