+ Reply to Thread
Results 1 to 2 of 2

Display,mail record in existing user form

Hybrid View

saba@thejaingroup.co Display,mail record in... 01-01-2017, 03:57 PM
saba@thejaingroup.co Re: Display,mail record in... 01-03-2017, 03:10 PM
  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    47

    Display,mail record in existing user form

    Hi,

    I need you help in a userform where the user input data which gets added to a hidden sheet (sheet1)
    What I require your help in is:1PNG.PNG
    • When the user input and click submit his record should be dispalyed
    • Mail his entred record using outlookDisplay
    • Fix the userform to a sheet,the user form need not float
    • In the designed form I have days name,I want to dispaly dates below each days name from the hidden sheet

    Please find the code below:
    Option Explicit
    Private Sub CommandButton1_Click()
    Dim iRow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("Sheet1")
    
    iRow = ws.Cells(Rows.Count, 2) _
    .End(xlUp).Offset(1, 0).Row
    
    
    
    
    'check for a part number
    If Trim(Me.TextBox1.Value) = "" Then
      Me.TextBox1.SetFocus
      MsgBox "Please enter your Code"
      Exit Sub
    End If
    
    'copy the data to the database
    ws.Cells(iRow, 2).Value = Me.TextBox1.Value
    ws.Cells(iRow, 14).Value = Me.ComboBox1.Value
    ws.Cells(iRow, 15).Value = Me.ComboBox2.Value
    ws.Cells(iRow, 16).Value = Me.ComboBox3.Value
    ws.Cells(iRow, 17).Value = Me.ComboBox4.Value
    ws.Cells(iRow, 18).Value = Me.ComboBox5.Value
    ws.Cells(iRow, 19).Value = Me.ComboBox6.Value
    ws.Cells(iRow, 20).Value = Me.ComboBox7.Value
    ws.Cells(iRow, 21).Value = Me.ComboBox8.Value
    ws.Cells(iRow, 22).Value = Me.ComboBox9.Value
    ws.Cells(iRow, 23).Value = Me.ComboBox10.Value
    
    'clear the data
    Me.TextBox1.Value = ""
    Me.ComboBox1.Value = ""
    Me.ComboBox2.Value = ""
    Me.ComboBox3.Value = ""
    Me.ComboBox4.Value = ""
    Me.ComboBox5.Value = ""
    Me.ComboBox6.Value = ""
    Me.ComboBox7.Value = ""
    Me.ComboBox8.Value = ""
    Me.ComboBox9.Value = ""
    Me.ComboBox10.Value = ""
    
    Me.TextBox1.SetFocus
    End Sub
    
    Private Sub CommandButton2_Click()
      Unload Me
      
     End Sub
    
    Private Sub UserForm_Initialize()
     
    ComboBox1.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox2.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox3.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox4.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox5.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox6.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox7.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox8.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox9.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
    ComboBox10.List = Array("13:30:00", "18:00:00", "09:00:00", "22:30:00", "Holiday", "Annual Leave", "Self Opted")
        
    End Sub

  2. #2
    Registered User
    Join Date
    12-18-2012
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Display,mail record in existing user form

    Can anyone suggest anything?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Adding new record to existing database table with a form
    By Mongoloid in forum Access Tables & Databases
    Replies: 2
    Last Post: 11-10-2016, 03:58 PM
  2. [SOLVED] Display a multi-line text box from User Form in a generated outlook e-mail
    By Tnashnhsp1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2015, 06:11 AM
  3. next and previous record on user form
    By adil mehboob in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2014, 01:53 AM
  4. Edit Record from User Form
    By bwilliamsuncc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-12-2012, 07:01 PM
  5. Navigation between record User Form
    By thameem127 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-08-2012, 07:25 AM
  6. Show look up results in user form and display warning if overwritting existing entry
    By yapjooleong in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2010, 01:50 PM
  7. Add next record using user form
    By rajeev.raj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2010, 02:15 AM

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