PDA

View Full Version : Doing a date out(radio button)twice where i want the 2nd time not allowed to



Alvinkiang
06-27-2006, 08:09 PM
Problem:
Firstly, my date in and date out is created using radio buttons.
i wants the system to be able to detect when a item is dated in, it is not allowed to do date in again for the same item unless the same item has been dated out. And if the item was dated out, it should not be able to date out the item again unless the item was dated in after being dated out. Right now, i can only do date in and date out successfully once.

heres my coding for above:




If (RtnIn.Value = True) Then
TempDateIn = Date

With Worksheets("Board_Movement")
.Activate
.Range("A1").Select
If TypeName(.Cells.Find(equidID, lookat:=xlWhole, _
MatchCase:=False)) = "Range" Then
MsgBox ("Equipment ID already in use, pls enter a new ID")
movement.Hide
movement.Show

Else

find_empty_cell ("A1")

Selection.Cells.Offset(1, 0) = equidID
Selection.Cells.Offset(1, 1) = TempDateIn

MsgBox ("you have successfully date in the Equipment!")
End If
End With


End If

TempDateOut = Date

If (RtnOut.Value = True) Then
With Worksheets("Board_Movement")
.Activate
.Range("A1").Select
If TypeName(.Cells.Find(equidID, lookat:=xlWhole, _
MatchCase:=False)) = "Range" Then 'Check for valid eq_ID
.Cells.Find(what:=equidID, lookat:=xlWhole, MatchCase:=False).Activate

Selection.Cells.Offset(0, 2) = TempDateOut



With Worksheets("pm_track")
.Activate
.Range("A1").Select

If TypeName(.Cells.Find(equidID1, lookat:=xlWhole, _
MatchCase:=False)) = "Range" Then
.Cells.Find(what:=equidID, lookat:=xlWhole, MatchCase:=False).Activate

addr = Selection.Row
Rows(addr).Select
Selection.Delete
MsgBox ("you have successfully date out the Equipment!")
End If
End With
End If
End With
End If

mdmackillop
06-27-2006, 11:08 PM
Hi Alvin,
Can you sanitise and post a copy of your workbook?
Regards
MD

Alvinkiang
06-28-2006, 12:19 AM
thxs for replying.. here is my coding~