Solved

Create a new database with VISDATA.

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

708 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