Hi,
Please refer the following code. I have put this code in the code window of the form which is bound to tblEmployeeMaster.
What I basically want is, from the year entered in the form by the user, I want to pick the YearID from tblLeaveYearMaster. "ID" is a PK of data type AutoNumber and Year is of data type long integer.
On running the following code, no matter what the year is selected in the form, it invariably store value 0 in LeaveYearID variable.
Please guide me.
Private Sub Form_AfterUpdate()
LeaveYearID As Integer
Dim dbs As Database
Set dbs = CurrentDb
Set dbs = CurrentDb
Months =
NoOfMonths(Fdate, LDate, DOJ, DOD)
LeaveYearID = "Select tblLeaveYearMaster.ID from tblLeaveYearMaster " _
& " WHERE tblLeaveYearMaster.Year = " & LeaveYear
& " WHERE tblLeaveYearMaster.Year = " & LeaveYear
dbs.Close
End Sub
Regards,
Rajesh Desai
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
Please zip all files prior to uploading to Files section.
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
