If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
#ERROR in textbox
I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced |
#2
|
|||
|
|||
#ERROR in textbox
Is the bound column of cboCustomerNumber a number field, and are Posting Date
Period and cboPostingDate date fields? Alan wrote: I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
#ERROR in textbox
No Customer Number is a Text Field and posting Date is a Date Field.
"BruceM via AccessMonster.com" wrote: Is the bound column of cboCustomerNumber a number field, and are Posting Date Period and cboPostingDate date fields? Alan wrote: I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced -- Message posted via http://www.accessmonster.com . |
#4
|
|||
|
|||
#ERROR in textbox
Apologies Posting Date period is a text field??
"BruceM via AccessMonster.com" wrote: Is the bound column of cboCustomerNumber a number field, and are Posting Date Period and cboPostingDate date fields? Alan wrote: I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced -- Message posted via http://www.accessmonster.com . |
#5
|
|||
|
|||
#ERROR in textbox
Alan -
If the field in the database is [Posting Period Date], then you have the field name wrong. Try this: =DSum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = '" & [cboCustomerNumber] & "' AND [Posting Period Date] = '" & Me.[cboPostingDate].Column(0) & "'") I am assuming cboPostingDate is a combo box, and the date you want is in the first column. If that date is a text value in the correct format (yyyymm), then the above should work. If not, you will need to add formatting to that. -- Daryl S "Alan" wrote: Apologies Posting Date period is a text field?? "BruceM via AccessMonster.com" wrote: Is the bound column of cboCustomerNumber a number field, and are Posting Date Period and cboPostingDate date fields? Alan wrote: I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced -- Message posted via http://www.accessmonster.com . |
#6
|
|||
|
|||
#ERROR in textbox
I just Get #Name error now??
Any suggestion "Daryl S" wrote: Alan - If the field in the database is [Posting Period Date], then you have the field name wrong. Try this: =DSum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = '" & [cboCustomerNumber] & "' AND [Posting Period Date] = '" & Me.[cboPostingDate].Column(0) & "'") I am assuming cboPostingDate is a combo box, and the date you want is in the first column. If that date is a text value in the correct format (yyyymm), then the above should work. If not, you will need to add formatting to that. -- Daryl S "Alan" wrote: Apologies Posting Date period is a text field?? "BruceM via AccessMonster.com" wrote: Is the bound column of cboCustomerNumber a number field, and are Posting Date Period and cboPostingDate date fields? Alan wrote: I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced -- Message posted via http://www.accessmonster.com . |
#7
|
|||
|
|||
#ERROR in textbox
See my reply in another part of this thread.
Alan wrote: I just Get #Name error now?? Any suggestion Alan - [quoted text clipped - 45 lines] Thanks in advanced -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201003/1 |
#8
|
|||
|
|||
#ERROR in textbox
Alan -
I changed the cboCustomerNumber assuming it is also a combo box, and the number is in the first field: =DSum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = '" & Me.[cboCustomerNumber].Column(0) & "' AND [Posting Period Date] = '" & Me.[cboPostingDate].Column(0) & "'") If it doesn't work, I would suggest adding the following before the DSum so you can see what is really being passed: Debug.Print Me.[cboCustomerNumber].Column(0) Debug.Print Me.[cboPostingDate].Column(0) The results will be in the immediate window when the code runs. Also check the exact spelling of the table and fieldnames, as we can't do that remotely... -- Daryl S "Alan" wrote: I just Get #Name error now?? Any suggestion "Daryl S" wrote: Alan - If the field in the database is [Posting Period Date], then you have the field name wrong. Try this: =DSum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = '" & [cboCustomerNumber] & "' AND [Posting Period Date] = '" & Me.[cboPostingDate].Column(0) & "'") I am assuming cboPostingDate is a combo box, and the date you want is in the first column. If that date is a text value in the correct format (yyyymm), then the above should work. If not, you will need to add formatting to that. -- Daryl S "Alan" wrote: Apologies Posting Date period is a text field?? "BruceM via AccessMonster.com" wrote: Is the bound column of cboCustomerNumber a number field, and are Posting Date Period and cboPostingDate date fields? Alan wrote: I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced -- Message posted via http://www.accessmonster.com . |
#9
|
|||
|
|||
#ERROR in textbox
Bruce, The cboCustomerNumber is a Text Field and the Posting Date is also a
text field, any suggestions "BruceM via AccessMonster.com" wrote: Is the bound column of cboCustomerNumber a number field, and are Posting Date Period and cboPostingDate date fields? Alan wrote: I have this code in a text box = dsum("[Amount]", "[July 09 - On Billings and Adjustments Data Query]", "[Customer No] = " & [cboCustomerNumber] & " AND Format([Posting Date Period], ""yyyymm"") = '" & Format([cboPostingDate], "yyyymm") & "'") i keep getting #error in my text box i'm struggling to find they answer to why the query July 09 - On Billings and Adjustments Data Query has fields of customer Number posting periood date Amount Now i have two combo boxes on my form which the text box should look up Customer number and Name, are bound to another table No (for customer Number) Name ( for customer Name Customer Listing Table not linked to July 09 - On Billings and Adjustments Data Query Is this what causing my error and how do i fix it Thanks in advanced -- Message posted via http://www.accessmonster.com . |
#10
|
|||
|
|||
#ERROR in textbox
As I wrote in another part of this thread:
Posting Date Period should be changed to a Date/Time field. The Format function seems to be able to apply date/time formatting to a text string that "looks" like a date, but if it is a date it should be stored in a date/time field. Be sure the exact field names, not any table field captions you may have used, are included in the DSum expression. Naming problems are typically the source of the #Name error. Also, please post some sample data (from just a few records) of the actual values in Posting Date Period. You have been exchanging some postings with Daryl S. I suggest that you stay in one part of the thread (the Daryl S part would be good), as it is difficult to know what you have tried when you questions are replies are scattered around the thread. Alan wrote: Bruce, The cboCustomerNumber is a Text Field and the Posting Date is also a text field, any suggestions Is the bound column of cboCustomerNumber a number field, and are Posting Date Period and cboPostingDate date fields? [quoted text clipped - 30 lines] Thanks in advanced -- Message posted via http://www.accessmonster.com |
|
Thread Tools | |
Display Modes | |
|
|