This might be what you need. It will create or modify an existing query with the name and sql string passed to it.
Code:
'---------------------------------------------------------------------------------------
' Procedure : fcnMakeNamedQuery
' DateTime : 9/26/2006 20:57
' Author : davegri
' Purpose : Attach new SQL property to an existing querydef. If the Query doesn't exist,
' : create it with the passed SQL.
'---------------------------------------------------------------------------------------
'
Function fcnMakeNamedQuery(qName As String, strPassedSQL As String)
Dim qthisQuery As DAO.QueryDef
If DCount("Name", "MSysObjects", "[Name] = " & Chr$(39) & qName & Chr$(39)) = 0 Then
Set qthisQuery = CurrentDb.CreateQueryDef(qName, strPassedSQL)
Else
Set qthisQuery = CurrentDb.QueryDefs(qName)
qthisQuery.SQL = strPassedSQL
End If
Application.RefreshDatabaseWindow
Set qthisQuery = Nothing
End Function
In your example, make the combobox rowsource qryGetPartName, not in code, but in the property window.
Then just modify the query with the function before using the combobox.
From your original post, you seem to think you need to run a query to use it. Not so, any more than you have to "run" a table to use it.