Lu - UrGeNt

Results 1 to 2 of 2

Thread: Lu - UrGeNt

  1. #1
    Join Date
    Dec 1969

    Default Lu - UrGeNt

    I wrote the Duplicate Function and still i have the same problem. <BR><BR>Private Function duplicate(strvalue As String) As Boolean <BR> Dim stext As String <BR> sCount = 0 <BR> dgrdTableMaint.Col = 0 <BR> Do <BR> dgrdTableMaint.Row = sCount <BR> stext = Trim(dgrdTableMaint.text) <BR> msgbox stext <BR> sCount = sCount = 1 <BR> Loop Until Len(stext) &#060;= 0 <BR> duplicate = False <BR>End Function <BR><BR>I was trying to display the grid values. It&#039;s not doing so. <BR>it&#039;s just displaying the lated added value for all the column <BR>although i change the row value.

  2. #2
    Join Date
    Dec 1969

    Default Don't understand your logic,

    i would do like this:<BR>Private Function Duplicate(ID As String) As Boolean<BR>Dim sSQL As String<BR>Dim rs As Recordset<BR> <BR> &#039;creates a recordset to populate Dangerous Goods Messages Grid<BR> sSQL = "Select ID, Message from Messages where ID=" &(ID)<BR> <BR> Set rs = New ADODB.Recordset<BR> With rs<BR> .CursorLocation = adUseClient<BR> .ActiveConnection = gConn<BR> .CursorType = adOpenKeyset<BR> .LockType = adLockOptimistic<BR> .Open sSQL<BR> End With<BR> <BR> If rs.RecordCount &#062; 0 Then<BR> <BR> Duplicate = True<BR> <BR> Else<BR> Duplicate = False<BR> End If<BR> <BR> rs.Close<BR><BR>End Function

Posting Permissions

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