A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

combo box look up text box error



 
 
Thread Tools Display Modes
  #1  
Old March 24th, 2010, 04:32 PM posted to microsoft.public.access.forms
Alan
external usenet poster
 
Posts: 459
Default combo box look up text box error

I used this code

=DSum("Amount",
"[July 09 - On Billings and Adjustments Data Query]",
" [Customer No#] = " & cboCustomerNumber &
" AND Format([Posting Date Period], ""yyyymm"") = '" &
Format(cboPostingDate, "yyyymm") & "'")

to put the values in my text box

but i'm just getting #error in the text box

i have Customer Number box pulling the Customer number from the customer
listing table, and the rest coming from the July 09 - On Billings and
Adjustments Data Query

, would this give me my error??

Thanks yous again for you expert advice
  #2  
Old March 24th, 2010, 05:17 PM posted to microsoft.public.access.forms
Dorian
external usenet poster
 
Posts: 542
Default combo box look up text box error

It's not advisable to use embedded spaces or any special characters in your
table or column names as it can cause problems.
The first thing to do is to display your query e.g.
Dim strSQL as string
strSQL = " [Customer No#] = " & cboCustomerNumber &
" AND Format([Posting Date Period], ""yyyymm"") = '" &
Format(cboPostingDate, "yyyymm") & "'"
Msgbox strSQL

to see what you are getting.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"Alan" wrote:

I used this code

=DSum("Amount",
"[July 09 - On Billings and Adjustments Data Query]",
" [Customer No#] = " & cboCustomerNumber &
" AND Format([Posting Date Period], ""yyyymm"") = '" &
Format(cboPostingDate, "yyyymm") & "'")

to put the values in my text box

but i'm just getting #error in the text box

i have Customer Number box pulling the Customer number from the customer
listing table, and the rest coming from the July 09 - On Billings and
Adjustments Data Query

, would this give me my error??

Thanks yous again for you expert advice

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.