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
   
  Months = NoOfMonths(Fdate, LDate, DOJ, DOD)

  LeaveYearID = "Select tblLeaveYearMaster.ID from tblLeaveYearMaster " _
& " 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.

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to