Advertisement
Advertisement
| 09.04.2008 at 10:41PM PDT, ID: 23705223 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: |
Sub AddNew()
'Update data on Sheet1 based on new exception entered on Sheet2
Dim Emplid As String
Dim Emplname As String
Dim TLname As String
Dim HH As Integer
Dim MM As Integer
Dim Fmm As Integer
Dim Exception As String
Dim Reason As String
Dim Exptime As Date
Dim LRow As Long
Dim LFound As Boolean
Dim Lnum As Integer
Dim Edate As Date
B: Sheets("New entry").Select
'Before adding new customer, make sure a value was entered
If IsEmpty(Range("I9").Value) = False Then
'Retrieve new information
Emplid = Range("I9").Value
Emplname = Range("I11").Value
TLname = Range("I13").Value
Exception = Range("E11").Value
Reason = Range("E17").Value
HH = Range("E13").Value
MM = Range("E14").Value
Fmm = HH * 60 + MM
Exptime = HH & ":" & MM
Edate = Date
Application.ScreenUpdating = False
'Move to Sheet1 to save the changes
Sheets("RAWDATA").Visible = -1
Sheets("RAWDATA").Select
Sheets("RAWDATA").Unprotect
LFound = False
LRow = 2
Do While LFound = False
'Encountered a blank project number (assuming end of list on Sheet1)
If IsEmpty(Range("A" & LRow).Value) = True Then
LFound = True
End If
LRow = LRow + 1
Loop
Range("A" & LRow - 1).Value = Lnum
Range("c" & LRow - 1).Value = TLname
Range("D" & LRow - 1).Value = Emplid
Range("E" & LRow - 1).Value = Emplname
Range("F" & LRow - 1).Value = Exception
Range("G" & LRow - 1).Value = Reason
Range("H" & LRow - 1).Value = Fmm
Range("B" & LRow - 1).Value = Edate
'Reposition back on Sheet2
'Sheets("Sheet2").Select
'Update range for combo boxes
'ActiveSheet.Shapes("Drop Down 3").Select
'With Selection
' .ListFillRange = "Sheet1!$B$2:$B$" & LRow - 1
' End With
'ActiveSheet.Shapes("Drop Down 8").Select
'With Selection
' .ListFillRange = "Sheet1!$B$2:$B$" & LRow - 1
'End With
'Clear entries from cells
With Sheets("new entry")
.Range("I9").Value = ""
.Range("E11").Value = ""
.Range("E17").Value = ""
.Range("E13").Value = ""
.Range("E14").Value = ""
End With
Sheets("New entry").Select
Range("I9").Select
Application.DisplayAlerts = False
Sheets("RAWDATA").Protect
Sheets("RAWDATA").Visible = 0
ActiveWorkbook.Save
Application.ScreenUpdating = True
Application.DisplayAlerts = True
MsgBox ("New Exception was successfully added.")
GoTo Z
Else: GoTo A
End If
A: Application.ScreenUpdating = True
MsgBox ("Please fill required fields with *")
Z: End Sub
Sub reset()
With Sheets("new entry")
.Range("I9").Value = ""
.Range("E11").Value = ""
.Range("E17").Value = ""
.Range("E13").Value = ""
.Range("E14").Value = ""
End With
End Sub
'this is the code which simply append data to Raw Data i have created the same table as raw data in MS access i want the same data to be append the the acess table too on the command button click press by the user on the new entry worksheet.
alsoi want to add an auto num with the every record that is appended in access table
|