F
fsuds
I have a form that I'm working on and it's almost complete except for a
problem I'm encounering with a combo box. The form's record source is a SQL
statement passed through open args from another form. All data shows except
the combo box and I'm assuming that is because it's row source contains
concatenated data.
How can I get this thing to display the correct data on form load? Here is
my code.
frmRentalSearch
Private Sub cmdEdit_Click()
Dim sSQL As String
sSQL = "Select RENTAL.[RID], RENTAL.[EVENTID]," & _
" ([EVENT].[Name])&', '&([EVENT].[FILENUMBER]) AS EVENT," & _
" RENTAL.[RENTALDATE], RENTALITEM.[RENTALID]," & _
" RENTAL.[RENTALITEM], RENTAL.[RENTALTYPE], RENTALITEM.[UNIT]," & _
" RENTAL.[PRICEPERUNIT], RENTAL.[QUANTITY]" & _
" FROM RENTALITEM, RENTAL, EVENT" & _
" WHERE forms![frmRentalSearch].[RID] = RENTAL.[RID]"
DoCmd.OpenForm "frmEditRental", acNormal, OpenArgs:=sSQL
End Sub
frmEditRental
Private Sub Form_Load()
Me.RecordSource = Me.OpenArgs
End Sub
problem I'm encounering with a combo box. The form's record source is a SQL
statement passed through open args from another form. All data shows except
the combo box and I'm assuming that is because it's row source contains
concatenated data.
How can I get this thing to display the correct data on form load? Here is
my code.
frmRentalSearch
Private Sub cmdEdit_Click()
Dim sSQL As String
sSQL = "Select RENTAL.[RID], RENTAL.[EVENTID]," & _
" ([EVENT].[Name])&', '&([EVENT].[FILENUMBER]) AS EVENT," & _
" RENTAL.[RENTALDATE], RENTALITEM.[RENTALID]," & _
" RENTAL.[RENTALITEM], RENTAL.[RENTALTYPE], RENTALITEM.[UNIT]," & _
" RENTAL.[PRICEPERUNIT], RENTAL.[QUANTITY]" & _
" FROM RENTALITEM, RENTAL, EVENT" & _
" WHERE forms![frmRentalSearch].[RID] = RENTAL.[RID]"
DoCmd.OpenForm "frmEditRental", acNormal, OpenArgs:=sSQL
End Sub
frmEditRental
Private Sub Form_Load()
Me.RecordSource = Me.OpenArgs
End Sub