Create a new database with VISDATA.

   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

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.

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"
    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"
End Sub

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

With rstCust
    !FirstName = strFirst
    !LastName = strLast
    !Phone = strPhone
    !Memo = strMemo
    .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:
Who is Participating?
JiaHConnect With a Mentor Commented:
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.
kamijpAuthor Commented:
Edited text of question

Here's my email if you want to send me your project i can look at it, send the spec also.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.