Hey
I have a table in access called Log_Table
Id like the user to press a button that checks if the value "KLAR" is in the column named "HRWEBB CHECK"
How do i do this?
Ive done it with Excel, but dont know how to make this code work in access
(code from excel, how to make this work in access)
The button the user will press is called
LogCheck_Button
The form that this is placed in is called
profile_form
Then when the user press the button and checks what rows have not the value "KLAR" in the column "HRWEBB CHECK" id like to
display all rows that does not have the value in a msgbox or in something else. With the data from the other columns in the table log_table.
I have a table in access called Log_Table
Id like the user to press a button that checks if the value "KLAR" is in the column named "HRWEBB CHECK"
How do i do this?
Ive done it with Excel, but dont know how to make this code work in access
(code from excel, how to make this work in access)
Code:
Dim ws As Worksheet
Dim lr As Long
Dim myKey
Dim myDict As Object
Dim myMsg As String
Dim i As Long
Set ws = Worksheets("LOG") 'change sheet name to the one being checked
lr = ws.Range("A" & Rows.Count).End(xlUp).Row
Set myDict = CreateObject("Scripting.Dictionary")
For i = 4 To lr 'change the 2 to the first row with data
If ws.Range("E" & i).Value = vbNullString Then
'myDict.Add i, ws.Range("A" & i).Value
myDict.Add i, ws.Range("A" & i).Value & " " & ws.Range("B" & i).Value & " - " & ws.Range("C" & i).Value & ": "
End If
Next i
For Each myKey In myDict.Keys
myMsg = myMsg & myDict(myKey) & "" & vbCrLf
Next myKey
If Len(myMsg) > 0 Then
MsgBox ("Följande frånvaro rapporter finns ej i HR-WEBB." & vbCrLf & "Kontrollera om rapport finns och markera rad som klar. " & vbCrLf & vbCrLf & Left(myMsg, Len(myMsg) - 1))
Else
MsgBox ("Alla rapporter är kollade mot HR-WEBB")
End If
Set myDict = Nothing
The button the user will press is called
LogCheck_Button
The form that this is placed in is called
profile_form
Then when the user press the button and checks what rows have not the value "KLAR" in the column "HRWEBB CHECK" id like to
display all rows that does not have the value in a msgbox or in something else. With the data from the other columns in the table log_table.