Solved

Create a new database with VISDATA.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

930 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now