Can you provide any screenshots along with explanations? Relationships?
You can of course copy over data from one form to another but without knowing more of your design and needs it is hard to advise.
You could use a combobox as a selection for the destination and then run code to append the...
I'm not going to debate the username thing. I disagree.
Still, here is an example you can modify to suit your needs.
Dim strSQL As String 'Log Changed Password to tblLostPassword.
strSQL = "INSERT INTO tblLostPassword (lastsignon,userID,pw ) "
strSQL = strSQL & "VALUES (#" &...
Doing that way is not advisable since Username is not reliable. Their are Demo's available in the Samples section. That said, it would be much better to use a DLookup for the user and password and compare against your table.
If you were designing a Payroll database and wanted to add absence and vacation time into it, Would you:
A. Add the Required fields to the Payroll and simply link to the others tables
B. Create subforms linked by PK and FK
C. How would you then track the absence and vacation time apart from...
Follow up question. Since I have a Composite Index to prevent duplicates I get the error message. How can I trap this?
I resolved it with this code.
Thanks,
'Trap Error.
Dim DataErr As Integer
Dim Response As Integer
Dim Message As String
If DataErr = 3022 Then 'Duplicate value entered...
I need to add HolDte and make it also use HolidayDate as it's criteria.
strSQL = "INSERT INTO tblHour (WorkDate,Hours,HolDay,EmployeeID) " _
& " VALUES (#" & Me.HolidayDate & "#," & Me.txtHrs & ",True," & Me.EmployeeID & ")"
Thanks for the suggestion. It does not seem to be working for me with my current design.
1. If some criteria then open form, do not open form.
2. Form opens and code runs to append data into table.
A. I would ideally opt to not have the form open via code if criteria is not met.
I don't want to allow more than one instance of (HolDte) for the same EmployeeID
If DLookup("[HolDte]", "tblHour", "[EmployeeID]='" & Me.EmployeeID.Value & "'") <> Me.HolDte.Value Then
Exit Sub
End If
No Problem, Still struggling with it. Latest Attempt. OnLoadEvent of form.
No errors when form opens? Debug shows code in red, syntax error is all.
Dim strSQL As String
Dim HolidayDate As Date
Dim AbsenceHrsID As Long
Dim EmployeeID As Long
Dim HolDay As Parameter
strSQL =...
Maybe that's the problem. The solution escapes me for now. I have tried this with a popup form and also a subform with no luck. Of course it has to a matching value for the Employee. EmployeeID to EmployeeID in popup form
Or EmployeeID to AbsenceTypeID in subform.
I will continue to test and...
Hmm, so far no issues with that field name!
Still, I get this error.
Error 3075 syntax error in (missing operator) query expression '4 WHERE
tblHour.EmployeeID=2'.)
Had to revise code, it was not what I wanted. Error is:
Error 3075 syntax error in query expression '#5/13/20154 WHERE tblHour.EmployeeID=2'.)
Dim strSQL As String
strSQL = "INSERT INTO tblHour (WorkDate,Hours) "
strSQL = strSQL & "VALUES (#" & Me.HolidayDate &...
Yes, it is a number.Revised Code,Error is missing operator in AbsenceHrsID
SSql = "UPDATE tblHour" _
& " SET tblHour.WorkDate = & Me.AbsenceHrsID " _
& " WHERE tblHour.EmployeeID= " & Me.EmployeeID