Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MS Access (http://www.go4expert.com/forums/ms-access-forum/)
-   -   Multiple Data Entry in Access (http://www.go4expert.com/forums/multiple-data-entry-access-t26083/)

BELEHU 17Jun2011 19:30

Multiple Data Entry in Access
 
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

apr pillai 18Aug2011 21:00

Re: Multiple Data Entry in Access
 
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

Enter the required change of Value in the ServiceType field and Double_Click on the field to make changes to all the records and come back to the record where you have made the change initialy.

You can see the changes happening on all the records one by one.


All times are GMT +5.5. The time now is 21:50.