wizz_darlo
Registered User.
- Local time
- Today, 01:40
- Joined
- Aug 1, 2005
- Messages
- 16
Hi,
I have one combo box on a form which I have set to lookup values on the form and display the details. I have the combo box to read the values from a table tblCommReport. The fields which I need to lookup are system number and report number.
The problem comes up because there can be more than one report for each system. So if I choose 3243 01 then it pulls up report number 01 for system 3243. However if i then click on 3243 02 it does nothing. The form doesn't show the next report.
Here is the code:
I created this using the wizard as I don't really have any skill with vB.
I tried to add Me.Requery or Me.Refresh in that code but it didn't seem to work.
I understand that the bound column of my combo box is System number, but is there no way to allow it to recognise that there is more than one entry for each system?
Also if somebody suggests that I use cascading combo boxes and to look in the example databases then I'm sorry but I have looked and I'm too much of a novice to adapt these to suit my needs. I'm obviously not sure but I seem to think the solution may not be that complicated.
I'd love it if somebody could help.
I have one combo box on a form which I have set to lookup values on the form and display the details. I have the combo box to read the values from a table tblCommReport. The fields which I need to lookup are system number and report number.
The problem comes up because there can be more than one report for each system. So if I choose 3243 01 then it pulls up report number 01 for system 3243. However if i then click on 3243 02 it does nothing. The form doesn't show the next report.
Here is the code:
Code:
Private Sub Combo95_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[System Number] = '" & Me![Combo95] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
I created this using the wizard as I don't really have any skill with vB.
I tried to add Me.Requery or Me.Refresh in that code but it didn't seem to work.
I understand that the bound column of my combo box is System number, but is there no way to allow it to recognise that there is more than one entry for each system?
Also if somebody suggests that I use cascading combo boxes and to look in the example databases then I'm sorry but I have looked and I'm too much of a novice to adapt these to suit my needs. I'm obviously not sure but I seem to think the solution may not be that complicated.
I'd love it if somebody could help.