Hello everyone.
I've been searching the forums and have been unable to find a good document, was hoping someone would be able to assist me.
Have an edit field and buttons on a form, that currently populate a list contro, all on the same forml. Example, you type in account number 999 into the edit feild, hit button_4 and list_0 gets populated with any accounts that match 999 string.
I am looking to add a drop down menu and some radio buttons, to futher limit the result populated in list_0.
So far I am using the following code with no isue, to populate list_0:
Code:
Public Sub SrchByAddr1_Click()
stdocname = "COMBO"
Me!
[List0] = "0"
Me.List0.RowSource = "SELECT [Main].[ProjectID], [Main].[Status], [Main].[CCOMID], [Main].[FIBERstaff], [Main].[SlsMgr], [Main].[ProjNme], [Main].[PTD], [Main].[Addr1], [Main].[Addr2], [Main].[City], [Main].ID FROM [Main] where [Main].[Addr1] like " & "'*" & Me!ProjectID & "*'" & "ORDER BY [ProjectID] DESC;"
End Sub
Code:
Public Sub List0_DblClick(Cancel As Integer)
On Error GoTo Err_List0_DblClick
Dim stLinkCriteria As String
Dim stdocname As String
stdocname = "Combo"
If CurrentProject.AllForms(stdocname).IsLoaded Then
MsgBox "The form you are attempting to open is already open." & _
vbNewLine & "Please save what you are working on then" & _
vbNewLine & "close the form. Then try this operation again.", vbOKOnly, "Form Already Open"
Else
stLinkCriteria = "[ID]=" & Me!
[List0]
If IsNull(Me!
[List0]) = False Then
IfMe!
[List0] <> 0 Then
DoCmd.OpenForm stdocname, , , stLinkCriteria
Else
MsgBox "Please select an account", vbOKOnly, "WARNING!"
End If
End If
End If
Exit_List0_DblClick:
Exit Sub
Err_List0_DblClick:
Response = MsgBox("Please select an account", vbOKOnly, "WARNING!", "DEMO.HLP", 1000)
Resume Exit_List0_DblClick
End Sub
I assume it has something to do with the 'select' section of the query, but I am unsure how or when to assign a variables value into the sql string, which is currently using rowsource to pop data.
I am still fairly new to all of this, sorry if my wording/terms are not correct.