Closed Thread
Results 1 to 4 of 4

code for creating form for logging phone call details

  1. #1
    Registered User
    Join Date
    10-01-2007
    Posts
    2

    code for creating form for logging phone call details

    Hi...I need to create a form to use in work so when people call I can log each call and input the data and save to a spreadsheet...I havn't used visual basic for a few years so need some help...I took what I could from a tutorial and edited it but I think ive balls'd it up somewhere...If anyone can help me I would appreciate it greatly.

    Ive uploaded a screen shot of what im trying to code here.

    http://img399.imageshack.us/img399/4...albasicur9.jpg


    Code:

    Private Sub cmdClearForm_Click()

    Call UserForm_Initialize

    End Sub



    Private Sub cmdOk_Click()
    ActiveWorkbook.Sheets("Course Bookings").Activate
    Range("A1").Select

    Do

    If IsEmpty(ActiveCell) = False Then
    ActiveCell.Offset(1, 0).Select
    End If

    Loop Until IsEmpty(ActiveCell) = True
    ActiveCell.Value = txtName.Value
    ActiveCell.Offset(0, 1) = txtPhone.Value
    ActiveCell.Offset(0, 2) = cboDepartment.Value
    End If

    Range("A1").Select
    End Sub


    Private Sub cmdButt_Click()
    Sub OpenCourseBookingForm()
    frmCourseBooking.Show
    End Sub


    Private Sub UserForm_Initialize()
    txtName.Value = ""
    txtPhone.Value = ""
    With cboDepartment
    .AddItem "Sales"

    .AddItem "Finance"

    .AddItem "Technical"

    .AddItem "Stores"

    .AddItem "Dispatch"
    End With
    cboDepartment.Value = ""
    End With
    txtCall.Value = ""
    End With

    refNature.Value = ""
    End Sub
    Last edited by grant8oy; 10-01-2007 at 07:03 AM.

  2. #2
    Registered User
    Join Date
    10-01-2007
    Posts
    2
    Can anyone help me please??

  3. #3
    Registered User
    Join Date
    10-01-2007
    Posts
    9
    Quote Originally Posted by grant8oy
    Hi...I need to create a form to use in work so when people call I can log each call and input the data and save to a spreadsheet...I havn't used visual basic for a few years so need some help...I took what I could from a tutorial and edited it but I think ive balls'd it up somewhere...If anyone can help me I would appreciate it greatly.

    Ive uploaded a screen shot of what im trying to code here.

    http://img399.imageshack.us/img399/4...albasicur9.jpg


    Code:
    WHat's it doing? (the sign of a truly lazy programmer)

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Take a look at the DatabaseForm example here:

    http://www.excel-it.com/vba_examples.htm
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1