Query not working anymore in A2007

P

PioPio

Hi there,

I was updated to Access 2007 and one query in my application is not working
anymore.

I have a form linked to a submask. This submask includes several forms and
each form shows invoice data (one form for each currency). The code below was
working with A2003 but not in A2007 anymore.


For Each ctl In Me.Maschera1.Controls
If ctl.ControlType = acPage Then
Me.Maschera1.Controls.Item(ctl.Name).Visible = Not (Me!
SubMaskCurrencies.Form.RecordsetClone.EOF)
If Me!SubMaskCurrencies.Form.RecordsetClone.EOF = False Then
Me.Maschera1.Controls.Item(ctl.Name).Caption = Me!
SubMaskCurrencies.Form.RecordsetClone.Fields("currency")
Me.Maschera1.Controls.Item(NSubmask).Controls.Item(0).Form.
RecordSource = "SELECT Tbl_Invoices.*, Tbl_Invoices.Update_date, Tbl_Invoices.
Currency, Tbl_Invoices.Overdue_Date FROM Tbl_Invoices WHERE (((Tbl_Invoices.
Update_date) = #" & Format(Date, "mm/dd/yyyy") & "#) And ((Tbl_Invoices.
Currency) = '" & Me!SubMaskCurrencies.Form.RecordsetClone.Fields("currency")
& "')) ORDER BY Tbl_Invoices.Overdue_Date;"
NSubmask = NSubmask + 2
Me!SubMaskCurrencies.Form.RecordsetClone.MoveNext
End If
End If
Next ctl


More in detail the following instruction is not working anymore:

Me.Maschera1.Controls.Item(NSubmask).Controls.Item(0).Form.RecordSource =
"SELECT Tbl_Invoices.*, Tbl_Invoices.Update_date, Tbl_Invoices.Currency, .....
.."


when Access executes this line the recordsource is not updated and no error
comes up.
I double checked and NSubmask value is correct, Controls.Item(0) is correct
too. Simply the string in Recordsource is not changed after A2007 executes
the line.
I tried to pass recordsource a string instead of an expression but nothing
happened

How can I fix it ? Has anything changed between A2003 and A2007 regarding
this point ?


Thanks a mill

Stay alive !
Pio Pio
 
P

PioPio via AccessMonster.com

PioPio said:
Hi there,

I was updated to Access 2007 and one query in my application is not working
anymore.

I have a form linked to a submask. This submask includes several forms and
each form shows invoice data (one form for each currency). The code below was
working with A2003 but not in A2007 anymore.

For Each ctl In Me.Maschera1.Controls
If ctl.ControlType = acPage Then
Me.Maschera1.Controls.Item(ctl.Name).Visible = Not (Me!
SubMaskCurrencies.Form.RecordsetClone.EOF)
If Me!SubMaskCurrencies.Form.RecordsetClone.EOF = False Then
Me.Maschera1.Controls.Item(ctl.Name).Caption = Me!
SubMaskCurrencies.Form.RecordsetClone.Fields("currency")
Me.Maschera1.Controls.Item(NSubmask).Controls.Item(0).Form.
RecordSource = "SELECT Tbl_Invoices.*, Tbl_Invoices.Update_date, Tbl_Invoices.
Currency, Tbl_Invoices.Overdue_Date FROM Tbl_Invoices WHERE (((Tbl_Invoices.
Update_date) = #" & Format(Date, "mm/dd/yyyy") & "#) And ((Tbl_Invoices.
Currency) = '" & Me!SubMaskCurrencies.Form.RecordsetClone.Fields("currency")
& "')) ORDER BY Tbl_Invoices.Overdue_Date;"
NSubmask = NSubmask + 2
Me!SubMaskCurrencies.Form.RecordsetClone.MoveNext
End If
End If
Next ctl

More in detail the following instruction is not working anymore:

Me.Maschera1.Controls.Item(NSubmask).Controls.Item(0).Form.RecordSource =
"SELECT Tbl_Invoices.*, Tbl_Invoices.Update_date, Tbl_Invoices.Currency, .....
.."

when Access executes this line the recordsource is NOT updated and no error
comes up.
I double checked and NSubmask value is correct, Controls.Item(0) is correct
too. Simply the string in Recordsource is not changed after A2007 executes
the line.
I tried to pass recordsource a string instead of an expression but nothing
happened

How can I fix it ? Has anything changed between A2003 and A2007 regarding
this point ?

Thanks a mill

Stay alive !
Pio Pio


I am sorry to ripropose this issue but I haven't still found the solution. Is
anyone aware of how to fix it ?

Many thanks

Stay alive !
Pio Pio
 
P

PioPio via AccessMonster.com

PioPio said:
Hi there,

I was updated to Access 2007 and one query in my application is not working
anymore.

I have a form linked to a submask. This submask includes several forms and
each form shows invoice data (one form for each currency). The code below was
working with A2003 but not in A2007 anymore.

For Each ctl In Me.Maschera1.Controls
If ctl.ControlType = acPage Then
Me.Maschera1.Controls.Item(ctl.Name).Visible = Not (Me!
SubMaskCurrencies.Form.RecordsetClone.EOF)
If Me!SubMaskCurrencies.Form.RecordsetClone.EOF = False Then
Me.Maschera1.Controls.Item(ctl.Name).Caption = Me!
SubMaskCurrencies.Form.RecordsetClone.Fields("currency")
Me.Maschera1.Controls.Item(NSubmask).Controls.Item(0).Form.
RecordSource = "SELECT Tbl_Invoices.*, Tbl_Invoices.Update_date, Tbl_Invoices.
Currency, Tbl_Invoices.Overdue_Date FROM Tbl_Invoices WHERE (((Tbl_Invoices.
Update_date) = #" & Format(Date, "mm/dd/yyyy") & "#) And ((Tbl_Invoices.
Currency) = '" & Me!SubMaskCurrencies.Form.RecordsetClone.Fields("currency")
& "')) ORDER BY Tbl_Invoices.Overdue_Date;"
NSubmask = NSubmask + 2
Me!SubMaskCurrencies.Form.RecordsetClone.MoveNext
End If
End If
Next ctl

More in detail the following instruction is not working anymore:

Me.Maschera1.Controls.Item(NSubmask).Controls.Item(0).Form.RecordSource =
"SELECT Tbl_Invoices.*, Tbl_Invoices.Update_date, Tbl_Invoices.Currency, .....
.."

when Access executes this line the recordsource is NOT updated and no error
comes up.
I double checked and NSubmask value is correct, Controls.Item(0) is correct
too. Simply the string in Recordsource is not changed after A2007 executes
the line.
I tried to pass recordsource a string instead of an expression but nothing
happened

How can I fix it ? Has anything changed between A2003 and A2007 regarding
this point ?

Thanks a mill

Stay alive !
Pio Pio


I am sorry to ripropose this issue but I haven't still found the solution. Is
anyone aware of how to fix it ?

Many thanks

Stay alive !
Pio Pio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top