473,320 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need help sending invoice data to a text box

Hi,
I am using a text box as the subject for an invoice email.
The textbox works fine for listing individual fields from the
tblOrders table as shown below:

="Hi, " & [First] & "
" & "Your order is as follows:" & "
" & "
" & "Order ID: " & [OrderID] & " " & " Order Date: " &
Format([OrderDate],"Short Date") & " " & " Ship Via: " & [ShipMethod]
& "
" & "
" & " Subtotal: " & Format([ItemsTotal],"Currency") & "
" & " Tax: " & Format([OrderTax],"Currency") & "
" & " Insurance: " & Format([OrderInsurance],"Currency") & "
" & " Shipping: " & Format([ShipPrice],"Currency") & "
" & " Total: " & Format([OrderTotal],"Currency") & "

Yields:

Hi, Shaleana
Your order is as follows:

Order ID: 472 Order Date: 12/25/2003 Ship Via: USPS Priority

Subtotal: $15.00
Tax: $0.00
Insurance: $0.00
Shipping: $3.85
Total: $18.85

This works great, but I'd like to add the Item details that come from
a separate table tblOrderDetails and are linked by the OrderID field.
It seems I need to loop through a recordset for the details but I am
not sure how to get the details onto the text box if it is linked to
the Orders table.

Can anyone help??
Nov 12 '05 #1
1 1402
Hi,

Do you set this string as ControlSource for your textbox?
In this case it becomes R/O, so you cannot write in it (or change its value
through the code)

Instead, you should let its ControlSource property empty (let the box
unbound), and somewhere in the code assign the text you want to appears in
the box to its value property

Like this

me.txtEmailMsgBox.value = "Hi, " & [First] & vbcrlf & "Your order is as
follows:" & ....

Then with VBA code in a loop, you can add the appropriate details text to
the box
rs is the recordset with your details data

do while not rs.eof
me.txtEmailMsgBox.value = me.txtEmailMsgBox.value & vbcrlf & <whatever
you need to get from RS's fields>
rs.movenext
loop

If you have any more questions, you can contact me.

HTH,
Bogdan Zamfir
___________________________

Independent consultant


"Glenn Profitt" <sh******@shaleana.com> wrote in message
news:91**************************@posting.google.c om...
Hi,
I am using a text box as the subject for an invoice email.
The textbox works fine for listing individual fields from the
tblOrders table as shown below:

="Hi, " & [First] & "
" & "Your order is as follows:" & "
" & "
" & "Order ID: " & [OrderID] & " " & " Order Date: " &
Format([OrderDate],"Short Date") & " " & " Ship Via: " & [ShipMethod]
& "
" & "
" & " Subtotal: " & Format([ItemsTotal],"Currency") & "
" & " Tax: " & Format([OrderTax],"Currency") & "
" & " Insurance: " & Format([OrderInsurance],"Currency") & "
" & " Shipping: " & Format([ShipPrice],"Currency") & "
" & " Total: " & Format([OrderTotal],"Currency") & "

Yields:

Hi, Shaleana
Your order is as follows:

Order ID: 472 Order Date: 12/25/2003 Ship Via: USPS Priority

Subtotal: $15.00
Tax: $0.00
Insurance: $0.00
Shipping: $3.85
Total: $18.85

This works great, but I'd like to add the Item details that come from
a separate table tblOrderDetails and are linked by the OrderID field.
It seems I need to loop through a recordset for the details but I am
not sure how to get the details onto the text box if it is linked to
the Orders table.

Can anyone help??

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: coder_1024 | last post by:
I'm trying to send a packet of binary data to a UDP server. If I send a text string, it works fine. If I attempt to send binary data, it sends a UDP packet with 0 bytes of data (just the...
1
by: D. Dante Lorenso | last post by:
I just wrote a PL/PGSQL function that is working, but I don't know why it is... I have a foreign key constraint defined on: transaction.invoice_id --> invoice.invoice_id But I did NOT state...
4
by: JC Mugs | last post by:
Problem: Have a data entry form that enters new records that we need to print invoices from when the form is completed. I expect to be able to place a command button on the form and print the...
0
by: TN Bella | last post by:
Hi, I am trying to get my compare validator to fire properly...Since I have panels the validator wouldn't work properly, the app would fire right but would insert the data regardless and the...
10
by: pcthug | last post by:
Hi All, I am creating multi-tier app in vb.net using visual studio .net. I create a invoice.vb class file with properties, events and methods. This also has a line item collection class...
1
by: robinsand | last post by:
I am a new C++ programmer. I am still having trouble with certain data types and constructors, among other things. I'm not sure if I've used "std::string" properly throughout this program. I need...
3
by: abadi | last post by:
I have ready invoices and I want to enter the invoice information in a form then print the entered information on the invoice. The enter information is not stored in the database. I tried to make a...
2
by: yellowarmy | last post by:
Theres two problems i have. 1) Theres a question i have to answer in a mock is that the company does invoices every month but i need it for to select invoice and then select the month whcih would...
0
by: TGS | last post by:
Hi, My objective is to send out invoice statements with database mail by means of a stored procedure. There are two tables, Table1 is customer information, Table2 is invoice information. Table 1...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.