Solved

Create a new database with VISDATA.

Posted on 1998-11-12
3
228 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

785 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