New to Access and a little frustrated...

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
 
M

Mr B

Smitty,

First, a list box does not have a "drop down arrow". A list box can have
scroll bars but not a drop down option. Only combo boxes have the drop down
arrow.

Next, you do not indicate what have you done to try to populate your list
box with data. If we know a little about what you have already tried, it
will allow us to try to help find the problems.

To populate a list box or a combo box, you must provide some type of "Row
Source" for it.

I would suggest that you go to Help and usiing the "Answer Wizzard" tab,
type in: "creating a list" and click "Search". One of the topics in the list
will be: "About creating a list box, combo box or drow down list box". Click
on that topic and start reading on that topic. Follow the appropriate links
to learn about using these controls.
 
K

Klatuu

The code you have for calculating a birthday goes in a standard module. If
you have any questions about it, please post back. I recognize the code
because I wrote it.
 
M

Mr B

Dave,

The reason that I did not respond to the question about the age calculation
was that I felt that Smitty should resolve one issue at at time. I was
assuming that he would post back.

I did not realize that you had written the CalcAge function. I appreciate
you work.
 
K

Klatuu

No problem. I assume the OP did a seach and found the code. I was just
trying to help out.
 
M

Mr B

Yeah, me too, Dave.

I have your efforts to have always been helpful. Sharing information and
assistance to each other is what this is all about.

Feel free to contact me anytime.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top