D
Dom Torrez
I've been trying to find a way to have Access 2003 pass a parameter to a back
end database function. I'm running Access as my front end with postgres as
my back end. I created a function in postgres which needs an ID passed in as
a parameter. Once the field is passed in as the parameter the function
returns a set of data which I need to use for populating the fields in my
form (read only). I can create a Pass-through query in Access with the ID
parameter "hard coded" into the select statement, and it works just fine. My
problem is that I need this to be a static parameter. I want Access to pass
this ID parameter into the pass through query dependant on which set of data
it is in. For example:
select * from dbfunction(forms![form1]![subform1]![subform2]![id]);
Another option I'm looking at is using VB. Something like:
Private Sub Form_Open(Cancel As Integer)
'pass in current idlocale as parameter to query against function.
Dim dbs As Database
Dim rsQuery As DAO.Recordset
Dim strSQL As String
Dim rsid As Integer
Set dbs = CurrentDb()
Set rsid = Me![idRecon]
strSQL = "SELECT idlocale, idrecon, imageid, activity, imagecategory, path,
whentaken, imagecaption FROM getReconImages(rsid)"
Set rsQuery = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
Set
Forms![LocalesDataEntry]![ReconnaissanceDataEntrySF]![ReconImagesSSF]![ImageCategory] = rsQuery![ImageCategory]
End Sub
Does anybody have a good way to accomplish this?
Please help!
-Dom Torrez
end database function. I'm running Access as my front end with postgres as
my back end. I created a function in postgres which needs an ID passed in as
a parameter. Once the field is passed in as the parameter the function
returns a set of data which I need to use for populating the fields in my
form (read only). I can create a Pass-through query in Access with the ID
parameter "hard coded" into the select statement, and it works just fine. My
problem is that I need this to be a static parameter. I want Access to pass
this ID parameter into the pass through query dependant on which set of data
it is in. For example:
select * from dbfunction(forms![form1]![subform1]![subform2]![id]);
Another option I'm looking at is using VB. Something like:
Private Sub Form_Open(Cancel As Integer)
'pass in current idlocale as parameter to query against function.
Dim dbs As Database
Dim rsQuery As DAO.Recordset
Dim strSQL As String
Dim rsid As Integer
Set dbs = CurrentDb()
Set rsid = Me![idRecon]
strSQL = "SELECT idlocale, idrecon, imageid, activity, imagecategory, path,
whentaken, imagecaption FROM getReconImages(rsid)"
Set rsQuery = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
Set
Forms![LocalesDataEntry]![ReconnaissanceDataEntrySF]![ReconImagesSSF]![ImageCategory] = rsQuery![ImageCategory]
End Sub
Does anybody have a good way to accomplish this?
Please help!
-Dom Torrez