Consulting

Results 1 to 3 of 3

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

  1. #1

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

    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

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Alvin,
    Can you sanitise and post a copy of your workbook?
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    thxs for replying.. here is my coding~

Posting Permissions

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