Gurus,
I am very new at Access Programming and really would appreciate some help. I have spent hours going through threads and just can seem to hit on the right key words.
My situation is that I have a table that will be use to create a combo box. The table (among others) has two columns: FundName and FundLevel. For example,
FUNDNAME FUNDLEVEL
Income 0
Tithes & Offerings 1
Building Rental 1
Interest Income 1
Expenses 0
Outside Giving 1
Co-op 2
Clovis Vanover 3
Salaries & Benefits 1
Pastor's Salary 2
I want to come up with a Combo Box (or maybe it should be a List and that is what I am doing wrong) that looks like:
Income
Tithes & Offerings
Building Rental
Interest Income
Expenses
Outside Giving
Co-op
Clovis Vanover
Salaries & Benefits
Pastor's Salary
I have been trying to perform the indentation with a procedure off the "Enter" event. (I was planning on getting rid of the spaces added in the "AfterUpdate" event.) Is there a better way? Are there formatting commands I can place in the SQL that will provide the indentation? I can still catch it in the "AfterUpdate" event to get rid of the spaces for storing in the destination table (not the Funds table). Here is the code I have been trying, but nothing is showing in the Combo Box.
Private Sub DefaultFundName_Enter()
Dim iCount As Integer
Dim strDesignatedFundName As String
Dim strFirstTime As String
strFirstTime = "N"
Set dbs = CurrentDb()
Set rst = dbs.openrecordset("SELECT DesignatedFundName " _
& " ,DesignatedFundLevel " _
& " FROM DesignatedFunds " _
& " ORDER BY DesignatedFundSequence "
rst.MoveFirst
Do Until rst.EOF
iCount = 1
strDesignatedFundName = rst!DesignatedFundName
While iCount < rst!DesignatedFundLevel
strDesignatedFundName = " " & strDesignatedFundName
iCount = iCount + 1
Wend
If strfirstime = "N" Then
Me.DefaultFundName.RowSource = strDesignatedFundName
Else
Me.DefaultFundName.RowSource = Me.DefaultFundName.RowSource _
& ";" _
& strDesignatedFundName
End If
rst.MoveNext
Loop
End Sub
Any help would be greatly appreciated.
Thanks,
GSDCazy
I am very new at Access Programming and really would appreciate some help. I have spent hours going through threads and just can seem to hit on the right key words.
My situation is that I have a table that will be use to create a combo box. The table (among others) has two columns: FundName and FundLevel. For example,
FUNDNAME FUNDLEVEL
Income 0
Tithes & Offerings 1
Building Rental 1
Interest Income 1
Expenses 0
Outside Giving 1
Co-op 2
Clovis Vanover 3
Salaries & Benefits 1
Pastor's Salary 2
I want to come up with a Combo Box (or maybe it should be a List and that is what I am doing wrong) that looks like:
Income
Tithes & Offerings
Building Rental
Interest Income
Expenses
Outside Giving
Co-op
Clovis Vanover
Salaries & Benefits
Pastor's Salary
I have been trying to perform the indentation with a procedure off the "Enter" event. (I was planning on getting rid of the spaces added in the "AfterUpdate" event.) Is there a better way? Are there formatting commands I can place in the SQL that will provide the indentation? I can still catch it in the "AfterUpdate" event to get rid of the spaces for storing in the destination table (not the Funds table). Here is the code I have been trying, but nothing is showing in the Combo Box.
Private Sub DefaultFundName_Enter()
Dim iCount As Integer
Dim strDesignatedFundName As String
Dim strFirstTime As String
strFirstTime = "N"
Set dbs = CurrentDb()
Set rst = dbs.openrecordset("SELECT DesignatedFundName " _
& " ,DesignatedFundLevel " _
& " FROM DesignatedFunds " _
& " ORDER BY DesignatedFundSequence "
rst.MoveFirst
Do Until rst.EOF
iCount = 1
strDesignatedFundName = rst!DesignatedFundName
While iCount < rst!DesignatedFundLevel
strDesignatedFundName = " " & strDesignatedFundName
iCount = iCount + 1
Wend
If strfirstime = "N" Then
Me.DefaultFundName.RowSource = strDesignatedFundName
Else
Me.DefaultFundName.RowSource = Me.DefaultFundName.RowSource _
& ";" _
& strDesignatedFundName
End If
rst.MoveNext
Loop
End Sub
Any help would be greatly appreciated.
Thanks,
GSDCazy