• USER FORM TO SEARCH (2000 sr 1)

    Author
    Topic
    #406350

    For HansV (my teacher) it know my prob for this work…

    OK! the project is finished!

    Suggestion and strategy for new Implement new add-in
    ===========================================
    note: i ahve insert in from new path the txt file in server01epf and not c:epf

    step by step

    i would want distribuite a to 5 user this wbook

    if the first user import the txt file one of this 5 user have a problem if it start the same macro to import a txt file?
    if the import is start in the same time from all user have a problem?

    Viewing 1 reply thread
    Author
    Replies
    • #841907

      Do you give each user a separate copy of the workbook, or is there one workbook that is used by all users?

      If all users need to work with the same workbook, please note that Excel is not very good at that. Although there is an option to make a workbook shared, I wouldn’t recommend using that. If you don’t share a workbook, only one user can edit a workbook at a time.

      If each user has a separate copy, there should be no problem if several of them import a text file at the same time. But then, changes made by one user will not be seen by the other users.

      • #841909

        No, i distribuite a separate wbook for each user (to the default mode not is possible make change in the wbook i locked all cells) the wbook is only for inquiry or searching…

        • #841911

          There should be no problem then. Opening a text file for input does not lock it, so several users can import it at the same time.

          • #843224

            my dear are you on line?

            i have unlock 2 text box for and permit a data entry from indirizzaio.show

            =====================================================
            I permit in event change this, and i would want to insert this condition:
            if insert 12/6 automaticly appear in text box 12/06/2004

            Private Sub TextBox34_Change()
            Cells(ScrollBar1.Value + 6, 21) = TextBox34)
            End Sub
            =======================================================
            I permit in event change this, and i would want to insert this condition:
            if insert 12 automaticly appear in text box 12,00
            if insert 12,00 automaticly appear in text box 12,00
            if insert 1200 automaticly appear in text box 1.200,00

            Private Sub TextBox35_Change()
            Cells(ScrollBar1.Value + 6, 22) = TextBox35
            End Sub
            =====================================================

            • #843241

              I wouldn’t use the Change event of the text boxes for this, but the Before Update event.

              Private Sub TextBox34_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
              If TextBox34 = “” Then
              Cells(ScrollBar1.Value + 6, 21).Value = “”
              ElseIf IsDate(TextBox34) Then
              Cells(ScrollBar1.Value + 6, 21).Value = CDate(TextBox34)
              TextBox34 = Format(TextBox34, “dd/mm/yyyy”)
              Else
              MsgBox “Please enter a valid date.”, vbExclamation
              Cancel = True
              End If
              End Sub

              Private Sub TextBox35_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
              If TextBox35 = “” Then
              Cells(ScrollBar1.Value + 6, 22).Value = “”
              ElseIf IsNumeric(TextBox35) Then
              Cells(ScrollBar1.Value + 6, 22).Value = CDbl(TextBox35)
              TextBox35 = Format(TextBox35, “0.00”)
              Else
              MsgBox “Please enter a valid number.”, vbExclamation
              Cancel = True
              End If
              End Sub

              2. Don’t forget to set the correct format in the cells on the worksheet, if you haven’t already done so:

              – Select column U (= column number 21)
              – Select Format | Cells… or press Ctrl+1
              – In the Number tab, select the Date category, then select a date format that looks like 14/03/2001.
              – Click OK.

              – Select column V (= column number 22)
              – Select Format | Cells… or press Ctrl+1
              – In the Number tab, select the Number category, and specify 2 decimal places.
              – Click OK.

            • #843340

              THIS LOOP NOT WORK…

              I have this routine and my problem is:

              if you insert 1 appear the msg box when the condition is If TextBox38 = “1” And TextBox21 = “36” Then MsgBox (“ASSEGNO PAGATO!”), , “ATTENZIONE…”

              but if i insert another number different to 1 clear the TextBox38 = “” else continue the routine…

              Private Sub TextBox38_Change()

              If TextBox38 = “1” And TextBox21 = “36” Then MsgBox (“ASSEGNO PAGATO!”), , “ATTENZIONE…”
              TextBox38 = “”

              continue from this

              Dim TROVATO As Boolean
              Dim I As Integer
              Dim A As String
              TROVATO = False
              For I = 2 To 10
              A = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 6)))
              If Right(TextBox38, 1) = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 6))) Then
              TextBox18 = Sheets(“DB AGENZIE”).Cells(I, 7)
              TROVATO = True
              Exit For
              End If

              Next I

              Cells(ScrollBar1.Value + 6, 20) = Indirizzario.TextBox18.Value
              Cells(ScrollBar1.Value + 6, 23) = Indirizzario.TextBox38.Value

              End Sub

            • #843431

              Sorry, it’s not clear to me what you want. Please try to be as clear as you can.

              1. If TextBox38 = “1” and TextBox21 = “36”, display a message box. Then what?
              2. If TextBox38 = “1” and TextBox21 “36”, then what?
              3. If TextBox38 “1”, clear TextBox38. Then what?

              If the user is only allowed to enter “1” in TextBox38, what is its purpose?

            • #843811

              i have solved:

              If TextBox38 = “1” And TextBox21 = “36” Then
              MsgBox (“ASSEGNO PAGATO!”), , “ATTENZIONE…”
              TextBox38 = “”
              TextBox18 = “”

              Else
              …..
              Dim TROVATO As Boolean
              Dim I As Integer
              Dim A As String

              Tks as usual…

              OH!OH!….

              .. but i have the msg box also with the txtbox 21 is =”55″

              in effect if txtbox36 i insert 1 or 2 or 3 or 4 and txt box 21 contain “36” it must appear the msg box with allert
              but if in txt box 21 contain a different “36” continue the ruoutine and skip the routine…

            • #843812

              i have solved:

              If TextBox38 = “1” And TextBox21 = “36” Then
              MsgBox (“ASSEGNO PAGATO!”), , “ATTENZIONE…”
              TextBox38 = “”
              TextBox18 = “”

              Else
              …..
              Dim TROVATO As Boolean
              Dim I As Integer
              Dim A As String

              Tks as usual…

              OH!OH!….

              .. but i have the msg box also with the txtbox 21 is =”55″

              in effect if txtbox36 i insert 1 or 2 or 3 or 4 and txt box 21 contain “36” it must appear the msg box with allert
              but if in txt box 21 contain a different “36” continue the ruoutine and skip the routine…

            • #843857

              unsolved prob HansV take a eyes…
              see my last post
              Tks

            • #843867

              Sorry, I still don’t understand the description.

            • #843924

              Whit the file in the “hand”…

              http://WWW.GSSITALY.COM/L0785.ZIP

              Sorry for the dimension!

              This is my last work and is completed 98%…

              test the condition in txt box in this routine:
              Private Sub TextBox38_Change()

              persist the error…
              still only many little problem….

            • #843934

              The “And” operator has precedence above the “Or” operator, so the line

              If TextBox38 = “1” Or TextBox38 = “2” Or TextBox38 = “3” Or TextBox38 = “4” And TextBox32 = “PAGATO” Then

              actually says: if TextBox38 equals “1” or “2” or “3” or (TextBox38 equals “4” and TextBox32 equals “PAGATO”) then etc. You must use ( and ) to change this:

              If (TextBox38 = “1” Or TextBox38 = “2” Or TextBox38 = “3” Or TextBox38 = “4”) And TextBox32 = “PAGATO” Then

            • #844042

              as usual,
              Music, music, “…only you”
              Tks.

              Suggestion:

              when the user form indirizzrio.show is called is better to fill the all txtbox with the information of first record, or not?

              same suggestion if i click on CommandButton8, CommandButton9, CommandButton10… from indirizzario?

              and if, you accept this solution, how to make this option?

              ====================================================================

              for you our project wath is the rating from 0 to 10?
              is a good idea to menage the record (insert, delete, modify…ecc.)

              ====================================================================

            • #844067

              I have attached the code for the command buttons; this will also load the first record into the form when opened.

              I do not know enough about what your spreadsheet actually does to rate it.

            • #844220

              TKS, for the .txt attch…

              another modify during the scroll or when appera to the default indirizzario.show:

              command button 8
              if the txt box32 contain “PAGATO” lock
              txtbox 35,38,34,18

              (in effect the value “PAGATO” no permit nothing modify (only view a record) from the user, but if in the txtbox 32 the value is “IMPAGATO” or “IMP. A.C.”)

              if the txt box32 contain “IMPAGATO” or “IMP. A.C.”
              un-lock

              txtbox 35,38,34,18

              For HansV:

              i have solved this problem with this

              Private Sub TextBox32_Change()

              If TextBox32 = “PAGATO” Then

              TextBox34.Enabled = False
              TextBox34.BackColor = &H808080

              TextBox18.Enabled = False
              TextBox18.BackColor = &H808080

              TextBox35.Enabled = False
              TextBox35.BackColor = &H808080
              Label35.BackColor = &H808080

              TextBox38.Enabled = False
              TextBox38.BackColor = &H808080
              Label19.BackColor = &H808080

              Label34.BackColor = &H808080

              Else

              TextBox34.Enabled = True
              TextBox34.BackColor = &HFFFFFF

              TextBox18.Enabled = True
              TextBox18.BackColor = &HFFFFFF

              TextBox35.Enabled = True
              TextBox35.BackColor = &HFFFFFF
              Label35.BackColor = &H80FF&

              TextBox38.Enabled = True
              TextBox38.BackColor = &HFFFFFF
              Label19.BackColor = &H80FF&

              Label34.BackColor = &H80FF&

              End If

              End Sub

            • #844221

              TKS, for the .txt attch…

              another modify during the scroll or when appera to the default indirizzario.show:

              command button 8
              if the txt box32 contain “PAGATO” lock
              txtbox 35,38,34,18

              (in effect the value “PAGATO” no permit nothing modify (only view a record) from the user, but if in the txtbox 32 the value is “IMPAGATO” or “IMP. A.C.”)

              if the txt box32 contain “IMPAGATO” or “IMP. A.C.”
              un-lock

              txtbox 35,38,34,18

              For HansV:

              i have solved this problem with this

              Private Sub TextBox32_Change()

              If TextBox32 = “PAGATO” Then

              TextBox34.Enabled = False
              TextBox34.BackColor = &H808080

              TextBox18.Enabled = False
              TextBox18.BackColor = &H808080

              TextBox35.Enabled = False
              TextBox35.BackColor = &H808080
              Label35.BackColor = &H808080

              TextBox38.Enabled = False
              TextBox38.BackColor = &H808080
              Label19.BackColor = &H808080

              Label34.BackColor = &H808080

              Else

              TextBox34.Enabled = True
              TextBox34.BackColor = &HFFFFFF

              TextBox18.Enabled = True
              TextBox18.BackColor = &HFFFFFF

              TextBox35.Enabled = True
              TextBox35.BackColor = &HFFFFFF
              Label35.BackColor = &H80FF&

              TextBox38.Enabled = True
              TextBox38.BackColor = &HFFFFFF
              Label19.BackColor = &H80FF&

              Label34.BackColor = &H80FF&

              End If

              End Sub

            • #844288

              I have insert your modify to suggest in txt attachment, and this modify work correct in l0785_totale and l0785_pagati when i clik on this from indirizzario command_click 8 and command_click 9 , but when i insert a comand not visible in this command_clik 10 the txtbox and the label are visible?????

              Note:
              Actually in the sheet l0785_cdi_50 not are present record

              but if i click twice on command_click10 the txtbox and label not appear(?????)

              Private Sub CommandButton10_Click()

              Dim c As Range
              Worksheets(“L0785_CDI_50”).Activate
              Set c = ActiveSheet.Range(“Q7”)
              TextBox28 = “L0785_CDI_50”
              Indirizzario.ComboBox1 = “”

              Indirizzario.Label34.Visible = False
              Indirizzario.TextBox34.Visible = False

              ‘ Check if there are records
              If c = “” Then
              ‘ No – leave combo box blank

              Indirizzario.ComboBox1.RowSource = “”

              TextBox1 = “”
              TextBox2 = “”
              TextBox3 = “”
              TextBox4 = “”
              TextBox5 = “”
              TextBox6 = “”
              TextBox7 = “”
              TextBox9 = “”
              TextBox11 = “”
              TextBox13 = “”
              TextBox14 = “”
              TextBox16 = “”
              TextBox18 = “”
              TextBox20 = “”
              TextBox21 = “”
              TextBox27 = “”
              TextBox30 = “”
              TextBox31 = “”
              TextBox32 = “”
              TextBox33 = “”
              TextBox34 = “”
              TextBox35 = “”
              TextBox36 = “”
              TextBox37 = “”
              TextBox38 = “”

              Else
              ‘ Yes, set row source
              Indirizzario.ComboBox1.RowSource = Range(Range(“Q7”), _
              Range(“Q65536”).End(xlUp)).Resize(, 2).Address(External:=True)

              TextBox2 = c.Value
              TextBox14 = c.Offset(0, -16).Value
              TextBox3 = c.Offset(0, -13).Value
              TextBox4 = c.Offset(0, -12).Value
              TextBox5 = c.Offset(0, -10).Value
              TextBox6 = c.Offset(0, -9).Value
              TextBox7 = c.Offset(0, -8).Value
              TextBox9 = c.Offset(0, -15).Value
              TextBox13 = c.Offset(0, -7).Value
              TextBox30 = c.Offset(0, -6).Value
              TextBox16 = c.Offset(0, -5).Value
              TextBox18 = c.Offset(0, 3).Value
              TextBox21 = c.Offset(0, -11).Value
              TextBox20 = c.Offset(0, -3).Value
              TextBox31 = c.Offset(0, -2).Value
              TextBox32 = c.Offset(0, -1).Value
              TextBox33 = c.Offset(0, 1).Value
              TextBox34 = Format((c.Offset(0, 4).Value), “##,##0.00”)
              TextBox35 = Format((c.Offset(0, 5).Value), “DD/MM/YYYYY”)
              TextBox38 = c.Offset(0, 6).Value

              Dim IY As Integer
              Dim TROVATO As Boolean
              Dim AY As String
              TROVATO = False
              For IY = 2 To 50
              AY = Trim(Str(Sheets(“DB AGENZIE”).Cells(IY, 1)))
              If Right(TextBox13, 4) = Trim(Str(Sheets(“DB AGENZIE”).Cells(IY, 1))) Then
              TextBox37 = Sheets(“DB AGENZIE”).Cells(IY, 3)
              TROVATO = True
              Exit For
              End If
              Next IY

              Dim I As Integer
              ‘Dim TROVATO As Boolean
              Dim A As String
              TROVATO = False
              For I = 2 To 50
              A = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 1)))
              If Right(TextBox9, 4) = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 1))) Then
              TextBox27 = Sheets(“DB AGENZIE”).Cells(I, 2)
              TextBox11 = Sheets(“DB AGENZIE”).Cells(I, 3)
              TROVATO = True
              Exit For
              End If
              Next I

              Dim IX As Integer
              Dim AX As String
              TROVATO = False
              For IX = 2 To 1500
              AX = Trim(Str(Sheets(“DB AGENZIE”).Cells(IX, 4)))
              If Right(TextBox20, 4) = Trim(Str(Sheets(“DB AGENZIE”).Cells(IX, 4))) Then
              TextBox36 = Sheets(“DB AGENZIE”).Cells(IX, 5)
              TROVATO = True
              Exit For
              End If
              Next IX
              End If

              CheckBox1.Value = False
              CheckBox2.Value = False
              CheckBox3.Value = True

              End Sub

            • #844289

              I have insert your modify to suggest in txt attachment, and this modify work correct in l0785_totale and l0785_pagati when i clik on this from indirizzario command_click 8 and command_click 9 , but when i insert a comand not visible in this command_clik 10 the txtbox and the label are visible?????

              Note:
              Actually in the sheet l0785_cdi_50 not are present record

              but if i click twice on command_click10 the txtbox and label not appear(?????)

              Private Sub CommandButton10_Click()

              Dim c As Range
              Worksheets(“L0785_CDI_50”).Activate
              Set c = ActiveSheet.Range(“Q7”)
              TextBox28 = “L0785_CDI_50”
              Indirizzario.ComboBox1 = “”

              Indirizzario.Label34.Visible = False
              Indirizzario.TextBox34.Visible = False

              ‘ Check if there are records
              If c = “” Then
              ‘ No – leave combo box blank

              Indirizzario.ComboBox1.RowSource = “”

              TextBox1 = “”
              TextBox2 = “”
              TextBox3 = “”
              TextBox4 = “”
              TextBox5 = “”
              TextBox6 = “”
              TextBox7 = “”
              TextBox9 = “”
              TextBox11 = “”
              TextBox13 = “”
              TextBox14 = “”
              TextBox16 = “”
              TextBox18 = “”
              TextBox20 = “”
              TextBox21 = “”
              TextBox27 = “”
              TextBox30 = “”
              TextBox31 = “”
              TextBox32 = “”
              TextBox33 = “”
              TextBox34 = “”
              TextBox35 = “”
              TextBox36 = “”
              TextBox37 = “”
              TextBox38 = “”

              Else
              ‘ Yes, set row source
              Indirizzario.ComboBox1.RowSource = Range(Range(“Q7”), _
              Range(“Q65536”).End(xlUp)).Resize(, 2).Address(External:=True)

              TextBox2 = c.Value
              TextBox14 = c.Offset(0, -16).Value
              TextBox3 = c.Offset(0, -13).Value
              TextBox4 = c.Offset(0, -12).Value
              TextBox5 = c.Offset(0, -10).Value
              TextBox6 = c.Offset(0, -9).Value
              TextBox7 = c.Offset(0, -8).Value
              TextBox9 = c.Offset(0, -15).Value
              TextBox13 = c.Offset(0, -7).Value
              TextBox30 = c.Offset(0, -6).Value
              TextBox16 = c.Offset(0, -5).Value
              TextBox18 = c.Offset(0, 3).Value
              TextBox21 = c.Offset(0, -11).Value
              TextBox20 = c.Offset(0, -3).Value
              TextBox31 = c.Offset(0, -2).Value
              TextBox32 = c.Offset(0, -1).Value
              TextBox33 = c.Offset(0, 1).Value
              TextBox34 = Format((c.Offset(0, 4).Value), “##,##0.00”)
              TextBox35 = Format((c.Offset(0, 5).Value), “DD/MM/YYYYY”)
              TextBox38 = c.Offset(0, 6).Value

              Dim IY As Integer
              Dim TROVATO As Boolean
              Dim AY As String
              TROVATO = False
              For IY = 2 To 50
              AY = Trim(Str(Sheets(“DB AGENZIE”).Cells(IY, 1)))
              If Right(TextBox13, 4) = Trim(Str(Sheets(“DB AGENZIE”).Cells(IY, 1))) Then
              TextBox37 = Sheets(“DB AGENZIE”).Cells(IY, 3)
              TROVATO = True
              Exit For
              End If
              Next IY

              Dim I As Integer
              ‘Dim TROVATO As Boolean
              Dim A As String
              TROVATO = False
              For I = 2 To 50
              A = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 1)))
              If Right(TextBox9, 4) = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 1))) Then
              TextBox27 = Sheets(“DB AGENZIE”).Cells(I, 2)
              TextBox11 = Sheets(“DB AGENZIE”).Cells(I, 3)
              TROVATO = True
              Exit For
              End If
              Next I

              Dim IX As Integer
              Dim AX As String
              TROVATO = False
              For IX = 2 To 1500
              AX = Trim(Str(Sheets(“DB AGENZIE”).Cells(IX, 4)))
              If Right(TextBox20, 4) = Trim(Str(Sheets(“DB AGENZIE”).Cells(IX, 4))) Then
              TextBox36 = Sheets(“DB AGENZIE”).Cells(IX, 5)
              TROVATO = True
              Exit For
              End If
              Next IX
              End If

              CheckBox1.Value = False
              CheckBox2.Value = False
              CheckBox3.Value = True

              End Sub

            • #844330

              BIG PROBLEM WHEN ISERTING A CODE!

              when i click on “cerca” and i select l0785_totale and dont scroll down, if i insert a value in txtbox 38 the relative value is print in the line 6, this line is the title of record (?????)… to the default is the first record in the line 7

              but if i scroll down with one click on the arrow all work fine…

              suggestion please….

            • #844331

              BIG PROBLEM WHEN ISERTING A CODE!

              when i click on “cerca” and i select l0785_totale and dont scroll down, if i insert a value in txtbox 38 the relative value is print in the line 6, this line is the title of record (?????)… to the default is the first record in the line 7

              but if i scroll down with one click on the arrow all work fine…

              suggestion please….

            • #844454

              HansV, please, not to abandon to me in this moment.
              see THE BIG PROBLEM
              Tks.
              http://www.wopr.com/cgi-bin/w3t/showflat.p…=0&fpart=2&vc=1

            • #844596

              Sal, please remember that I’m a volunteer, like every other Lounger. I can’t spend all day answering your questions.

              I can’t reproduce your problem since I’m unable to enter anything in TextBox38. this is because you wanted to prevent the user from modifying TextBox38 if TextBox32 contains “PAGATO”.

            • #844682

              HansV, sorry for my urgent problem…
              i dont disturbe you… for the future? crybaby
              Tks, for your patience…

            • #844683

              HansV, sorry for my urgent problem…
              i dont disturbe you… for the future? crybaby
              Tks, for your patience…

            • #844068

              I have attached the code for the command buttons; this will also load the first record into the form when opened.

              I do not know enough about what your spreadsheet actually does to rate it.

            • #844043

              as usual,
              Music, music, “…only you”
              Tks.

              Suggestion:

              when the user form indirizzrio.show is called is better to fill the all txtbox with the information of first record, or not?

              same suggestion if i click on CommandButton8, CommandButton9, CommandButton10… from indirizzario?

              and if, you accept this solution, how to make this option?

              ====================================================================

              for you our project wath is the rating from 0 to 10?
              is a good idea to menage the record (insert, delete, modify…ecc.)

              ====================================================================

            • #844063

              sorry, is possible to insert also the modify
              ….
              if you insert a number >4 it must appear msg box “attention this choice is not possible!”

              if <4 ok go to the next part of code….
              ….

              the choice is only 1,2,3, or 4 if you have seen in the hide sheet DB AGENZIE
              …..

            • #844075

              Add this at the beginning of TextBox38_Change:

              If Not (TextBox38 = “” Or TextBox38 = “1” Or TextBox38 = “2” Or TextBox38 = “3” Or TextBox38 = “4”) Then
              MsgBox “Enter 1, 2, 3 or 4.”, vbExclamation
              TextBox38 = “”
              Exit Sub
              End If

            • #844076

              Add this at the beginning of TextBox38_Change:

              If Not (TextBox38 = “” Or TextBox38 = “1” Or TextBox38 = “2” Or TextBox38 = “3” Or TextBox38 = “4”) Then
              MsgBox “Enter 1, 2, 3 or 4.”, vbExclamation
              TextBox38 = “”
              Exit Sub
              End If

            • #844064

              sorry, is possible to insert also the modify
              ….
              if you insert a number >4 it must appear msg box “attention this choice is not possible!”

              if <4 ok go to the next part of code….
              ….

              the choice is only 1,2,3, or 4 if you have seen in the hide sheet DB AGENZIE
              …..

            • #843935

              The “And” operator has precedence above the “Or” operator, so the line

              If TextBox38 = “1” Or TextBox38 = “2” Or TextBox38 = “3” Or TextBox38 = “4” And TextBox32 = “PAGATO” Then

              actually says: if TextBox38 equals “1” or “2” or “3” or (TextBox38 equals “4” and TextBox32 equals “PAGATO”) then etc. You must use ( and ) to change this:

              If (TextBox38 = “1” Or TextBox38 = “2” Or TextBox38 = “3” Or TextBox38 = “4”) And TextBox32 = “PAGATO” Then

            • #843925

              Whit the file in the “hand”…

              http://WWW.GSSITALY.COM/L0785.ZIP

              Sorry for the dimension!

              This is my last work and is completed 98%…

              test the condition in txt box in this routine:
              Private Sub TextBox38_Change()

              persist the error…
              still only many little problem….

            • #843868

              Sorry, I still don’t understand the description.

            • #843858

              unsolved prob HansV take a eyes…
              see my last post
              Tks

            • #843432

              Sorry, it’s not clear to me what you want. Please try to be as clear as you can.

              1. If TextBox38 = “1” and TextBox21 = “36”, display a message box. Then what?
              2. If TextBox38 = “1” and TextBox21 “36”, then what?
              3. If TextBox38 “1”, clear TextBox38. Then what?

              If the user is only allowed to enter “1” in TextBox38, what is its purpose?

            • #843341

              THIS LOOP NOT WORK…

              I have this routine and my problem is:

              if you insert 1 appear the msg box when the condition is If TextBox38 = “1” And TextBox21 = “36” Then MsgBox (“ASSEGNO PAGATO!”), , “ATTENZIONE…”

              but if i insert another number different to 1 clear the TextBox38 = “” else continue the routine…

              Private Sub TextBox38_Change()

              If TextBox38 = “1” And TextBox21 = “36” Then MsgBox (“ASSEGNO PAGATO!”), , “ATTENZIONE…”
              TextBox38 = “”

              continue from this

              Dim TROVATO As Boolean
              Dim I As Integer
              Dim A As String
              TROVATO = False
              For I = 2 To 10
              A = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 6)))
              If Right(TextBox38, 1) = Trim(Str(Sheets(“DB AGENZIE”).Cells(I, 6))) Then
              TextBox18 = Sheets(“DB AGENZIE”).Cells(I, 7)
              TROVATO = True
              Exit For
              End If

              Next I

              Cells(ScrollBar1.Value + 6, 20) = Indirizzario.TextBox18.Value
              Cells(ScrollBar1.Value + 6, 23) = Indirizzario.TextBox38.Value

              End Sub

            • #843242

              I wouldn’t use the Change event of the text boxes for this, but the Before Update event.

              Private Sub TextBox34_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
              If TextBox34 = “” Then
              Cells(ScrollBar1.Value + 6, 21).Value = “”
              ElseIf IsDate(TextBox34) Then
              Cells(ScrollBar1.Value + 6, 21).Value = CDate(TextBox34)
              TextBox34 = Format(TextBox34, “dd/mm/yyyy”)
              Else
              MsgBox “Please enter a valid date.”, vbExclamation
              Cancel = True
              End If
              End Sub

              Private Sub TextBox35_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
              If TextBox35 = “” Then
              Cells(ScrollBar1.Value + 6, 22).Value = “”
              ElseIf IsNumeric(TextBox35) Then
              Cells(ScrollBar1.Value + 6, 22).Value = CDbl(TextBox35)
              TextBox35 = Format(TextBox35, “0.00”)
              Else
              MsgBox “Please enter a valid number.”, vbExclamation
              Cancel = True
              End If
              End Sub

              2. Don’t forget to set the correct format in the cells on the worksheet, if you haven’t already done so:

              – Select column U (= column number 21)
              – Select Format | Cells… or press Ctrl+1
              – In the Number tab, select the Date category, then select a date format that looks like 14/03/2001.
              – Click OK.

              – Select column V (= column number 22)
              – Select Format | Cells… or press Ctrl+1
              – In the Number tab, select the Number category, and specify 2 decimal places.
              – Click OK.

          • #843225

            my dear are you on line?

            i have unlock 2 text box for and permit a data entry from indirizzaio.show

            =====================================================
            I permit in event change this, and i would want to insert this condition:
            if insert 12/6 automaticly appear in text box 12/06/2004

            Private Sub TextBox34_Change()
            Cells(ScrollBar1.Value + 6, 21) = TextBox34)
            End Sub
            =======================================================
            I permit in event change this, and i would want to insert this condition:
            if insert 12 automaticly appear in text box 12,00
            if insert 12,00 automaticly appear in text box 12,00
            if insert 1200 automaticly appear in text box 1.200,00

            Private Sub TextBox35_Change()
            Cells(ScrollBar1.Value + 6, 22) = TextBox35
            End Sub
            =====================================================

        • #841912

          There should be no problem then. Opening a text file for input does not lock it, so several users can import it at the same time.

      • #841910

        No, i distribuite a separate wbook for each user (to the default mode not is possible make change in the wbook i locked all cells) the wbook is only for inquiry or searching…

    • #841908

      Do you give each user a separate copy of the workbook, or is there one workbook that is used by all users?

      If all users need to work with the same workbook, please note that Excel is not very good at that. Although there is an option to make a workbook shared, I wouldn’t recommend using that. If you don’t share a workbook, only one user can edit a workbook at a time.

      If each user has a separate copy, there should be no problem if several of them import a text file at the same time. But then, changes made by one user will not be seen by the other users.

    Viewing 1 reply thread
    Reply To: USER FORM TO SEARCH (2000 sr 1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: