473,404 Members | 2,179 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,404 software developers and data experts.

Scripting a listing of items from a table's column

MitchR
65 64KB
I am trying to Script a listing of items from a table. These items would show in an email generated by the script. The email generation is good ... My question is how to script the listing of items in the email. My Table is Called Term. My Listing is from the User.
Nov 27 '06 #1
7 1792
PEB
1,418 Expert 1GB
I am trying to Script a listing of items from a table. These items would show in an email generated by the script. The email generation is good ... My question is how to script the listing of items in the email. My Table is Called Term. My Listing is from the User.
What is it??? Scripting a listing of items??? Can u give an exemple?
Nov 27 '06 #2
MitchR
65 64KB
Private Sub Command0_Click()
Dim rec As Long
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text
Dim RecDate As Variant '-- Rec date for e-mail text
Dim stSubject As String '-- Subject line of e-mail
Dim varserial_num As Variant '-- The ticket ID from form
Dim varWho As Variant '-- Reference to tblUsers
Dim strSQL As String '-- Create SQL update statement
Dim myDate As Variant '-- Current Date
Dim varmgr As Variant
Dim errLoop As Error
Dim Err_EMail As Error
On Error GoTo Err_Command0_Click
myDate = Date
rec = CurrentRecord
Dim db As Database
Dim rs As Recordset
Dim mailList As String
varWho = Email
' varmgr = manager_ee
' This Code was Generated by ikon1\mrettberg
If IsNull(varWho) Or varWho = "" Then 'IsNull variable is null it evaluates to True the Or varWho = "" covers an empty string
MsgBox "Please Enter A Valid E-Mail Address Prior To Attempting Notification", , "Incomplete Information"
Exit Sub
End If
varserial_num = Serial_num
RecDate = Date
'DLookup to Term Database for End User Name
' varTo = DLookup("[end user]", "Term", "[serial_num] = [Forms]![term_sub]![serial_num]")
' varUser = DLookup("[User]", "Term", "[serial_num] = [Forms]![Term_sub]![serial_num]")
stSubject = "Return of Computer Assets from Termination of " & [User]
stText = "Good Day to You: " & [SUPERVISOR_NAME] & vbCrLf & vbCrLf & _
"This letter is to inform you that we have received termination notice of " & [User] & _
" on " & [Act_Term_date] & " and we are inquiring as to the return of his or her computer equipment." & vbCrLf & vbCrLf & _
"We have a couple of loose ends to tie up and then we will be all set." & vbCrLf & vbCrLf & _
"1.I need for you to check the bag and verify all accessories are present" & vbCrLf & _
"2.I need for you to place the laptop inside the laptop bag. Place the bag into a box with at least 2 inches of packing material on all 6 sides (top, bottom, and all four sides) and ship it overnight ... with an insured value of $3500 to the following address: " & RecDate & vbCrLf & vbCrLf & _
"Asset ID: " & Asset_ID & vbCrLf & _
"Asset Type: " & Asset_Type & vbCrLf & _
"Serial #: " & Serial_num & vbCrLf & vbCrLf & _
"Mitch Rettberg" & vbCrLf & _
"10 Patewood Drive" & vbCrLf & _
"Suite 300 Building 6" & vbCrLf & _
"Greenville, SC 29615" & vbCrLf & vbCrLf & vbCrLf & vbCrLf & _
"Send me an email with the Property of IKON Number & Tracking Number at mrettberg@ikon.com" & vbCrLf & _
"That is all" & vbCrLf & vbCrLf & _
LstBox = (User) & _
"Thank you and have a Great Day"
Nov 27 '06 #3
NeoPa
32,556 Expert Mod 16PB
What do you want to include in your e-mail?
Field names?
Data held in records?
If it's data then it would be query based and if it's the structure you'd need to get that from looping through your table structure in VBA.
Nov 27 '06 #4
MitchR
65 64KB
What do you want to include in your e-mail?
Field names?
Data held in records?
If it's data then it would be query based and if it's the structure you'd need to get that from looping through your table structure in VBA.
I want my email to include all items listed under the column User in my Terms. In a manner similar to a combo box listing all items in a column
Nov 27 '06 #5
NeoPa
32,556 Expert Mod 16PB
If your table is called Terms and the field required is User then you need to get your data from a query like
Expand|Select|Wrap|Line Numbers
  1. SELECT [User]
  2. FROM [Terms]
I don't know how you get that data into the e-mail - not my area - but that's the data you want anyway.
Nov 27 '06 #6
MitchR
65 64KB
Thank you NeoPa .... I was able to start the ball rolling with your help and with some additional guidance was able to resolve my issue: Here is the answer that resolved the problem:

Scripting the contents of a column into a generated email
Dec 11 '06 #7
NeoPa
32,556 Expert Mod 16PB
I'm pleased I could help.
Thanks for posting the answer link btw.
Dec 11 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

41
by: Richard James | last post by:
Are we looking at the scripting world through Python colored glasses? Has Python development been sleeping while the world of scripting languages has passed us Pythonista's by? On Saturday...
9
by: Håkon Helgesen | last post by:
Hello! I am using php to get a result from a MySql Query, but the listing is too long to have in one column. Can i use CSS to get my result in several column? How? PS. This is the very first...
5
by: rdraider | last post by:
Hi all, I'm looking for a way to re-number inventory items. The items exist in 50+ tables, hundreds of fields and there are several thousand items. Maybe one table could hold the list of old &...
4
by: jbesr1230 | last post by:
Hello, How would I print out a listing of the queries that are in a database? I would like to have a spreadsheet style listing with the columns of: Query Name, Description, Modified Date, Created...
3
by: Bennett Haselton | last post by:
I want to display a hierarchical listing of items from a database table, where, say, each row in the table has an "ID" field and a "parent_id" field giving the ID of its parent (NULL if it's at the...
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
0
by: helloitsme | last post by:
Hello! Can someone please guide me to do the following - I am using a combobox on my form. I want the items of this combobox to come from a column in one of my database tables. Something like...
3
by: zuchowra | last post by:
Hello everyone. Im running Access 2007. The form i created logs a persons ID badge number and personal information however, i want to make a section that lists their skills. So I will add a button...
1
by: KrazyKasper | last post by:
Access 2003 – Multi-Column List Box – Select Multiple Items I have a multi-column (3 columns) list box that works well to select one set of records or all sets of records (based on the first field...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.