Public Parameters

benc

Registered User.
Local time
Today, 21:29
Joined
Dec 31, 2001
Messages
57
I have a problem with public variables, I tried exactly what Pat Hardman wrote in Public Variables as Parameters and found that my returnfunction would always be a null value even though my GV did have a value. here is my code:

MODULE:

Option Compare Database

Dim gvactype As String

Public Function Returngvactype() As String
Returngvactype = gvactype
End Function

FORM TO ENTER VALUE:

Option Compare Database

Private Sub searchparts_Click()

gvactype = Me.frmactype

MsgBox gvactype

'i have created the msgbox to makesure the values have entered

DoCmd.openform "FrmPartslistresults"

End Sub

QUERY IN WHICH TO RECALL THE VARIABLE:

WHERE ((([tblA/CParts].[Aircraft Type])=returngvactype())

Id be gratefull if you could help me with this many thanks.
 
Thanks that worked, and sorry about your name.
 
I found a further problem that when i try to edit the results of the query in datasheet view they are un editiable. Am i not allowed to edit the results or is there something wrong
 
Since alot of the source is from Pat.. and this post is a few days old now, you may want to Private Message him with your question. Unless by me adding this it gets re-noticed. :)

Good luck!
 

Users who are viewing this thread

Back
Top Bottom