S
Scott Trowbridge
Hello,
I've got a module that has a function that I'm reading data from into a
recordset; which works very nicely. Now I'm tring to read information from
'dealer_rst' structure and fill in fields on a form (ie. me.dealer_name =
daler_rst!dealer_name). But as you can guess it doesn't work. Someone
recommended using:
grid.datasource.recordset.fields("nameofa field")
but... there is very little out on the internet on this function that I can
understand.
Can anyone point me in the right direction?
Scott
***********************************************************
Public dealer_rst As DAO.Recordset
-----------------------------------------------
Function check_dealer(needed_dealer As String)
On Error GoTo Err_on_check_dealer
Set dealer_rst = CurrentDb.OpenRecordset("SELECT dealer.* " & _
" FROM dealer WHERE ((DEALER)= '" & needed_dealer &
"')")
check_dealer = dealer_rst.recordcount
Exit Function
Err_on_check_dealer:
check_dealer = -1
system_log_file ("Error ->ERR #: " & Err.Number & _
" DESC: " & Err.Description & _
" FUNCT: check_dealer() No variable.")
End Function
Function check_ALL_dealer()
On Error GoTo Err_on_check_ALL_dealer
Set dealer_rst = CurrentDb.OpenRecordset("SELECT dealer.* FROM dealer")
check_ALL_dealer = dealer_rst.recordcount
Exit Function
Err_on_check_ALL_dealer:
check_ALL_dealer = -1
system_log_file ("Error ->ERR #: " & Err.Number & _
" DESC: " & Err.Description & _
" FUNCT: check_ALL_dealer() No variable.")
End Function
I've got a module that has a function that I'm reading data from into a
recordset; which works very nicely. Now I'm tring to read information from
'dealer_rst' structure and fill in fields on a form (ie. me.dealer_name =
daler_rst!dealer_name). But as you can guess it doesn't work. Someone
recommended using:
grid.datasource.recordset.fields("nameofa field")
but... there is very little out on the internet on this function that I can
understand.
Can anyone point me in the right direction?
Scott
***********************************************************
Public dealer_rst As DAO.Recordset
-----------------------------------------------
Function check_dealer(needed_dealer As String)
On Error GoTo Err_on_check_dealer
Set dealer_rst = CurrentDb.OpenRecordset("SELECT dealer.* " & _
" FROM dealer WHERE ((DEALER)= '" & needed_dealer &
"')")
check_dealer = dealer_rst.recordcount
Exit Function
Err_on_check_dealer:
check_dealer = -1
system_log_file ("Error ->ERR #: " & Err.Number & _
" DESC: " & Err.Description & _
" FUNCT: check_dealer() No variable.")
End Function
Function check_ALL_dealer()
On Error GoTo Err_on_check_ALL_dealer
Set dealer_rst = CurrentDb.OpenRecordset("SELECT dealer.* FROM dealer")
check_ALL_dealer = dealer_rst.recordcount
Exit Function
Err_on_check_ALL_dealer:
check_ALL_dealer = -1
system_log_file ("Error ->ERR #: " & Err.Number & _
" DESC: " & Err.Description & _
" FUNCT: check_ALL_dealer() No variable.")
End Function