I know I should not be doing this, but I find it very useful. I have a
database in Access which stores data for a small company. Sometimes we
need to add similar information to different tables. Currently I am
already doing something similar by copying certain records into the
same table. The only thing that changes is one field.
Please look at the code:
Dim MyDb As DAO.Database, MyRs As DAO.Recordset
Dim strCode As String
Dim strFilter As String
Set MyDb = CurrentDb
Set MyRs = MyDb.OpenRecord set("APPLICATIO NS")
MyRs.AddNew
MyRs!SSN = Forms!APPLICATI ONS!SSN
MyRs!FNAME = Forms!APPLICATI ONS!FNAME
MyRs!LNAME = Forms!APPLICATI ONS!LNAME
MyRs!RECEIVED = Forms!APPLICATI ONS!RECEIVED
MyRs!CLOSED = Forms!APPLICATI ONS!CLOSED
MyRs!INITIALS = Forms!APPLICATI ONS!INITIALS
MyRs.Update
strCode = DMax("[ID]", "Applicatio ns")
strFilter = "(([ID] = " & strCode & ")) "
DoCmd.ApplyFilt er , strFilter
Me.Refresh
Me.CODE.SetFocu s
If IsNull([CODE]) Then
MsgBox "Please enter the Claim TYPE!. ", vbOKOnly
Me!CODE.SetFocu s
End If
As you will notice there may be one field with no data. In that case
the input box will come up and users can type the required info.
Any help?
As was now wandering if is possible to export the same information
into a different table, let's say named REPORTS. The code should copy
the data i have typed in the active form, and paste in into this other
table.
database in Access which stores data for a small company. Sometimes we
need to add similar information to different tables. Currently I am
already doing something similar by copying certain records into the
same table. The only thing that changes is one field.
Please look at the code:
Dim MyDb As DAO.Database, MyRs As DAO.Recordset
Dim strCode As String
Dim strFilter As String
Set MyDb = CurrentDb
Set MyRs = MyDb.OpenRecord set("APPLICATIO NS")
MyRs.AddNew
MyRs!SSN = Forms!APPLICATI ONS!SSN
MyRs!FNAME = Forms!APPLICATI ONS!FNAME
MyRs!LNAME = Forms!APPLICATI ONS!LNAME
MyRs!RECEIVED = Forms!APPLICATI ONS!RECEIVED
MyRs!CLOSED = Forms!APPLICATI ONS!CLOSED
MyRs!INITIALS = Forms!APPLICATI ONS!INITIALS
MyRs.Update
strCode = DMax("[ID]", "Applicatio ns")
strFilter = "(([ID] = " & strCode & ")) "
DoCmd.ApplyFilt er , strFilter
Me.Refresh
Me.CODE.SetFocu s
If IsNull([CODE]) Then
MsgBox "Please enter the Claim TYPE!. ", vbOKOnly
Me!CODE.SetFocu s
End If
As you will notice there may be one field with no data. In that case
the input box will come up and users can type the required info.
Any help?
As was now wandering if is possible to export the same information
into a different table, let's say named REPORTS. The code should copy
the data i have typed in the active form, and paste in into this other
table.
Comment