I have been workign on a database project over the last several months for my company. I am a co-op student(basically a paid intern) who has had no formal training in programming.
I have a form which will display powerpoints, excels, and pictures based on the selections of two combo boxes. The user can then use the form to record what work was done by pressing a button. The button activiates coding which stores the pertinate information in a table. It works quite well and doesn't seem to have any more bugs at the momnent.
However, this record of work requires that the supervisors can be able to look up the work done. I want to create a reprt that would dispay the table with the stored information based on the selections of two comboboxes (I plan to recycle the coding from the form to accomplish that portion). I have no knowledge of reports and what they do, so I'm limited by experience as to what I understand. I know enough to see that this should be possible, it would just require a bit of help from people more knowledgable..
Ultimately I want help creating a report that would display the entries in the table using the two combo boxes as filters. If you have any suggestions, ideas, or links that you think would be helpful, please post them. I am still learning about what Access can do and everything you suggest helps me gain that much more information.
TIA
CarsonJ
Here is the code that I use to populate the two combo boxes if that helps:
CODE
'Searches the designated directory for folders and then will list folder names in combobox1
myPath = "J:\Directory\"
MyName = Dir(myPath, vbDirectory)
Do While Len(MyName) > 0
If MyName <> "." And MyName <> ".." Then
If (GetAttr(myPath & MyName) And vbDirectory) = vbDirectory Then
MyName2 = MyName2 & MyName & ";"
End If
End If
MyName = Dir
Loop
If Len(MyName2) > 0 Then
MyName2 = Left$(MyName2, Len(MyName2) - 1)
With Me.Combo0
.RowSource = MyName2
.RowSourceType = "Value List"
End With
End If
End Sub
Private Sub Combo0_AfterUpdate()
'Upon selecting one of the folder names, will search for excels in that folder
Dim strDir As String
Dim filter As String
filter = "*.xls"
strDir = "J:\Directory\" & Combo0.Text
File_Search strDir, filter
End Sub
'will populate the 2nd combobox with the filenames of the excels found
Sub File_Search(dirStr As String, filter As String)
Dim Search_path, Search_Filter, Search_Fullname As String
Dim DocName As String
Dim i As Long
DocName = Dir(dirStr & "\" & filter)
Do Until DocName = ""
Search_Fullname = Search_Fullname & ";" & DocName
DocName = Dir
Loop
With Me.Combo1
.RowSource = Search_Fullname
.RowSourceType = "Value List"
End With
End Sub
myPath = "J:\Directory\"
MyName = Dir(myPath, vbDirectory)
Do While Len(MyName) > 0
If MyName <> "." And MyName <> ".." Then
If (GetAttr(myPath & MyName) And vbDirectory) = vbDirectory Then
MyName2 = MyName2 & MyName & ";"
End If
End If
MyName = Dir
Loop
If Len(MyName2) > 0 Then
MyName2 = Left$(MyName2, Len(MyName2) - 1)
With Me.Combo0
.RowSource = MyName2
.RowSourceType = "Value List"
End With
End If
End Sub
Private Sub Combo0_AfterUpdate()
'Upon selecting one of the folder names, will search for excels in that folder
Dim strDir As String
Dim filter As String
filter = "*.xls"
strDir = "J:\Directory\" & Combo0.Text
File_Search strDir, filter
End Sub
'will populate the 2nd combobox with the filenames of the excels found
Sub File_Search(dirStr As String, filter As String)
Dim Search_path, Search_Filter, Search_Fullname As String
Dim DocName As String
Dim i As Long
DocName = Dir(dirStr & "\" & filter)
Do Until DocName = ""
Search_Fullname = Search_Fullname & ";" & DocName
DocName = Dir
Loop
With Me.Combo1
.RowSource = Search_Fullname
.RowSourceType = "Value List"
End With
End Sub
