Solved

Create a new database with VISDATA.

Posted on 1998-11-12
3
234 Views
Last Modified: 2013-12-25
Hi,
   I have to creat a database as a project and I have this problem to solve:
    " You work for XYZ company and your boss tells you that your company is in need of an application that will track customer phone calls. You must also have the ability to forward that information to employees that only have access to e-mail on a mainframe computer. This is in the extra section.

Step 1
Since we have no existing database you will have to create one. Visual Basic has the ability to create a Microsoft Access database without having to have any additional software.

The information that you will have to keep track of is:
Customer ID
First Name
Last Name
Phone Number
Notes

hints:       1.   On the Visual Basic menu bar under Add-Ins you will see Data Manager…
      2.   You will need a field that automatically counts up. This will be the customer ID.
      3.   First Name, Last Name, and Phone Number will be text fields.
      4.   The notes field will need to be a memo field.

Step 2
Build a front end application that will allow you to add records, delete records and find records.
The notes section will be where the user inputs most of the information.
Try having a button that will automatically enter the date and time into the memo box for the user.
   you must use the Common Dialog Control to connect to the database.  Do NOT hard-code file names into your program.

Step 3
Since we need to be able to e-mail the current record, output the contents of the text boxes to a text file on the hard drive. Later, the user could send that text file as a attachment in e-mail.

Hints:      1.   For the time and date there is a VB Function called Date( )
2.  If you want to add the date to the next line, try using a carriage return and linefeed. You will need a visual basic function called Chr$( ) and pass it the value 13 and then call it again with the value of 10. Don’t forget about the on-line help."
    I'll send a copy of my codes to let you know what I have done so far.Please in your answers explain why and what you are doing.
Thanks,
         Kamijp

Private Sub Command1_Click()
    Call AddNewRecord
End Sub

Private Sub ExitmunItem_Click()
    Unload Me
End Sub

Private Sub Form_Load()
CommonDialog1.Filter = "Database Files (*.mdb)|*.mdb"
    CommonDialog1.ShowOpen
    Data1.DatabaseName = CommonDialog1.filename
End Sub

Private Sub OpenmunItem_Click()
CommonDialog1.Filter = "Database Files (*.mdb)|*.mdb"
    CommonDialog1.Action = 1
    Data1.DatabaseName = CommonDialog1.filename
    Data1.RecordSource = "Customers"
    Data1.Refresh
End Sub

Function AddRecord(rstCust As Recordset, strFirst As String, _
strLast As String, strPhone As String, strMemo As String)

With rstCust
    .AddNew
    !FirstName = strFirst
    !LastName = strLast
    !Phone = strPhone
    !Memo = strMemo
    .Update
    .Bookmark = .LastModified
End With
End Function

Sub AddNewRecord()
Dim dbsLab4 As Database
Dim rstCustomers As Recordset
Dim strFirstName As String
Dim strLastName As String
Dim strPhoneNumber As String
Dim strMemo As String
Set dbsLab4 = OpenDatabase("Lab4.mdb")
Set rstCustomers = dbsLab4.OpenRecordset("Customers", dbOpenDynaset)

strFirstName = Trim(InputBox("Enter first name:"))
strLastName = Trim(InputBox("Enter last name:"))
strPhoneNumber = Trim(InputBox("Enter phone number:"))
strMemo = Trim(InputBox("Enter your memo:"))

If strFirstName <> "" And strLastName <> "" And _
strPhoneNumber <> "" Then
AddRecord rstCustomers, strFirstName, strLastName, _
strPhoneNumber, strMemo
End If
End Sub


PS: I can send you this project via email, if you send me your email address.
send email to: k.msadr@din.or.jp
0
Comment
Question by:kamijp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Author Comment

by:kamijp
ID: 1497627
Edited text of question
0
 
LVL 2

Expert Comment

by:dabellei
ID: 1497628
progiclip@netc.net

Here's my email if you want to send me your project i can look at it, send the spec also.
0
 
LVL 2

Accepted Solution

by:
JiaH earned 200 total points
ID: 1497629
Since your spec is very clear, you need create a database (VISDATA shiped with VB can be used). After the database been created, you can use the "Data Form Wizard" to create a form that can add/remove/delete/update the record. What left for you is do some changes to the code and add the other function according your spec. Use Date and Time can get the current date and time, and use vbCrLf to add a carriage return and linefeed.

How this helps.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question