Babycat
Member
- Local time
- Today, 15:31
- Joined
- Mar 31, 2020
- Messages
- 285
Hi everyone.
I have seen alot DB design with table, query, form and report... The table and form are essential i think. However, do we really need to make the fixed queries (save it with a name in navigation panel)?
Instead of making a query, I usually use SQL string and and assign it to form's recordsource with VBA, for example:
In this way i have maximum flexibility to change the record source on the fly (when program is running).
But I am not sure if any advantage and disadvantage when doing this. Speed, CPU resource?
Below is an example of fixed query, Then form's record source is set to query Q_ProductID in form design
Please help to explain in detail if any difference btw these two ways.
Regards,
I have seen alot DB design with table, query, form and report... The table and form are essential i think. However, do we really need to make the fixed queries (save it with a name in navigation panel)?
Instead of making a query, I usually use SQL string and and assign it to form's recordsource with VBA, for example:
Code:
SQLsub = User_SQLTableString_SubTransDetail _
& "WHERE TBLPRODUCT.ProductID like '" & Cbx_F_MaVT & "' " _
& " ORDER BY TBLTRANSACTION.CreatedDate DESC ;"
Forms!FrmTransDetail.Form!SubFrmTrans.Form.RecordSource = SQLsub
In this way i have maximum flexibility to change the record source on the fly (when program is running).
But I am not sure if any advantage and disadvantage when doing this. Speed, CPU resource?
Below is an example of fixed query, Then form's record source is set to query Q_ProductID in form design
Please help to explain in detail if any difference btw these two ways.
Regards,