S
Smitty
I'm new to using Access 2003. My background is in LAN/WAN networking, so I'm
a little lost in this area. Any help or suggestions you can give me is
greatly appreciated. I have two issues I'm dealing with.
1. Creating an unbound List: I'm able to create the list, but I'm having a
difficult time getting the data to populate in the list. The drop-down arrow
doesn't even appear on the list box. What have I done wrong here. Any
examples are greatly appreciated.
2. Calculating Age based on two dates (DOB & 12/31/2008). I have seen a
couple of replies in reference to this issue. My question is, what is it and
where do I put this information in Access? Example:
Public Function CalcAge(Bdate As Variant, Optional DateToday As Variant) As
Integer
Dim dtmToDate As Date
' Returns the Age in years between 2 dates
' Doesn't handle negative date ranges i.e. Bdate > DateToday
' Returns 0 if Bdate is Null
' Uses current date if DateToday is missing or Null
If IsNull(Bdate) Then
CalcAge = 0
Else
If IsMissing(DateToday) Then
dtmToDate = Date
Else
dtmToDate = Nz(DateToday, Date)
End If
If Month(dtmToDate) < Month(Bdate) Or (Month(dtmToDate) = _
Month(Bdate) And Day(dtmToDate) < Day(Bdate)) Then
CalcAge = Year(dtmToDate) - Year(Bdate) - 1
Else
CalcAge = Year(dtmToDate) - Year(Bdate)
End If
End If
End Function
a little lost in this area. Any help or suggestions you can give me is
greatly appreciated. I have two issues I'm dealing with.
1. Creating an unbound List: I'm able to create the list, but I'm having a
difficult time getting the data to populate in the list. The drop-down arrow
doesn't even appear on the list box. What have I done wrong here. Any
examples are greatly appreciated.
2. Calculating Age based on two dates (DOB & 12/31/2008). I have seen a
couple of replies in reference to this issue. My question is, what is it and
where do I put this information in Access? Example:
Public Function CalcAge(Bdate As Variant, Optional DateToday As Variant) As
Integer
Dim dtmToDate As Date
' Returns the Age in years between 2 dates
' Doesn't handle negative date ranges i.e. Bdate > DateToday
' Returns 0 if Bdate is Null
' Uses current date if DateToday is missing or Null
If IsNull(Bdate) Then
CalcAge = 0
Else
If IsMissing(DateToday) Then
dtmToDate = Date
Else
dtmToDate = Nz(DateToday, Date)
End If
If Month(dtmToDate) < Month(Bdate) Or (Month(dtmToDate) = _
Month(Bdate) And Day(dtmToDate) < Day(Bdate)) Then
CalcAge = Year(dtmToDate) - Year(Bdate) - 1
Else
CalcAge = Year(dtmToDate) - Year(Bdate)
End If
End If
End Function