G
Guest
I am converting an Access database to an Access Project (adp file). There is
an unbound form that has lots of controls with contol source like this one:
=-(IIf([AsAt] Is Null Or [Begin] Is
Null,Null,nz(DSum("[Amount]","Cashier","[DateOfPayment]>=Forms!TB!Begin And
[DateOfPayment]<=Forms!TB!AsAt And [CashOrCheque]=1 And
[PostedBy]<>Null"),0)+nz(DSum("[RechargeAmount]","AccountRecharging","[RechargeDate]>=Forms!TB!Begin
and [RechargeDate]<=Forms!TB!AsAt And [CashOrCheque]=1 And
[PostedBy]<>Null"),0)-nz(DSum("[PaymentAmount]","Payment","[PaymentDate]>=Forms!TB!Begin
And [PaymentDate]<=Forms!Tb!AsAt And [CashOrCheque]=1 And
[PostedBy]<>Null"),0)-nz(DSum("[Debit]","GLCLodgementDetail","[TDate]>=Forms!TB!Begin And [TDate]<=Forms!TB!AsAt And [CashOrCheque]=1"),0)))
The attraction for this is that each contol can be edited on the "surface"
without going into the form code. Can a similar thing be done in the Access
Project, i.e. make an SQL statement the control source of a control?
2. What would be the correct syntax for selecting records by the date data
fields in an Access Project since whereconditions like *...
[TDate]<=Forms!TB!AsAt ...* (TDate and AsAt are date fields in the underlying
table and form respectively) did not do any filtering at all?
I really hope someone can help me out as I am new to ADO and SQL Server
programming.
an unbound form that has lots of controls with contol source like this one:
=-(IIf([AsAt] Is Null Or [Begin] Is
Null,Null,nz(DSum("[Amount]","Cashier","[DateOfPayment]>=Forms!TB!Begin And
[DateOfPayment]<=Forms!TB!AsAt And [CashOrCheque]=1 And
[PostedBy]<>Null"),0)+nz(DSum("[RechargeAmount]","AccountRecharging","[RechargeDate]>=Forms!TB!Begin
and [RechargeDate]<=Forms!TB!AsAt And [CashOrCheque]=1 And
[PostedBy]<>Null"),0)-nz(DSum("[PaymentAmount]","Payment","[PaymentDate]>=Forms!TB!Begin
And [PaymentDate]<=Forms!Tb!AsAt And [CashOrCheque]=1 And
[PostedBy]<>Null"),0)-nz(DSum("[Debit]","GLCLodgementDetail","[TDate]>=Forms!TB!Begin And [TDate]<=Forms!TB!AsAt And [CashOrCheque]=1"),0)))
The attraction for this is that each contol can be edited on the "surface"
without going into the form code. Can a similar thing be done in the Access
Project, i.e. make an SQL statement the control source of a control?
2. What would be the correct syntax for selecting records by the date data
fields in an Access Project since whereconditions like *...
[TDate]<=Forms!TB!AsAt ...* (TDate and AsAt are date fields in the underlying
table and form respectively) did not do any filtering at all?
I really hope someone can help me out as I am new to ADO and SQL Server
programming.