User Profile

Collapse

Profile Sidebar

Collapse
Luk3r
Luk3r
Last Activity: Sep 8 '20, 04:13 PM
Joined: Jan 14 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • You just need to explicitly specify the additional form name before the array or variable.
    Code:
    lstMisc.Items.Add(MiscForm.intMisc1)
    Also worth noting is that some of the ElseIf statements on your MiscForm will never be hit because the former criteria will be matched every time. In the example below, the latter should be moved above the former.

    Code:
             ElseIf intMisc1 = intGripTape And intMisc2 = intBearings Then
    ...
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to TextBox.SelectAll() doesn't work - sometimes
    I believe this is a case of needing to suppress the event because you're not actually wanting the ENTER key to do work, simply trigger work. Add the following code after your ".SelectAll ()" code.

    Code:
    e.SuppressKeyPess  = true;
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to error in insert into satatement
    I see a couple of things wrong here.

    1) The question marks in your string should be parameters that you are replacing if the string is built the way you're trying to do so. That being said, it appears that you're trying to insert values? I'm not really sure, sorry.

    2) The command you're using to add parameter values should be ".AddWithValue" , not ".Add" when building a string in this manner....
    See more | Go to post

    Leave a comment:


  • Your code is nearly there. In your subs, you should add code to tell the cursor to go to the end of the text. Add this to the end of both subs:
    Code:
    Meeting_Notes.SelectionStart = Meeting_Notes.Text.Length + 1
    and you should change your KeyDown event to a KeyUp event. The enter key itself actually fires on the KeyDown event which causes the line return, so you'll want work to take place after that, which is the KeyUp event. Then...
    See more | Go to post

    Leave a comment:


  • This may be a silly answer, but couldn't this be accomplished with a Form_Load event OR by passing the name from your original Form? I'm not sure if it's the Form's title(text) that you're wanting to change or if it's some sort of label on the second form, but this should be fairly simple. Please note that Environment.Get EnvironmentVari able() can be substituted with a value from a textbox or inputbox. For example:

    Form Open Examp...
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to FindFirst not working
    Phil,
    Have you tried adding single quotes around your values instead of trying to interpret them as integers?

    Code:
    Criteria = "[WordNo] = '" & WordNo & "' AND [LanguageID] = '" & LanguageID & "'"
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to using Convert in SQL
    Your code is reading v_date as a column in the table, when in fact, it is not a column within the table. Try this and let us know if you have any luck!

    Code:
    SELECT A.v_date
    FROM (
    SELECT  Convert(varchar(2),DATEPART(MONTH, regi_datetimein)) + '/' + Convert(varchar(2),DATEPART(DAY, regi_datetimein)) + '/' + Convert(varchar(4),DATEPART(year, regi_datetimein)) as v_date 
    FROM [DB04_Visitors].[dbo].[T040200_REGISTRATION]
    ...
    See more | Go to post

    Leave a comment:


  • This code will literally concatenate the string onto itself. (Example: If the string is 'test' and the limit is 2, the result will be 'testtest'). You were very close.

    Code:
            public static string DoubleString(string aString, int limit)
            {
                limit = aString.Length * limit;
                do
                {
                    aString += aString;
                } while (aString.Length < limit);
    ...
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to C# - convert 'days old' to date of birth
    This would be the easiest way in my opinion:
    Code:
    DateTime birthDate = DateTime.Now.AddDays(-1095);
    See more | Go to post

    Leave a comment:


  • You're very close already. Here is the answer: DateTime.DaysIn Month(DateTime. Today.Year, DateTime.Today. Month)

    Here is an example:
    Code:
            private void button1_Click(object sender, EventArgs e)
            {
                MessageBox.Show(DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month).ToString());
            }
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to Radio Buttons
    There is definitely a way to do this. Depending on whether or not your radio buttons sit on the main form or in some other type of container the below code would need modified.

    Code:
            For Each rButton In Controls.OfType(Of RadioButton)()
                If rButton.Checked = True Then
                    MsgBox(rButton.Name & " is checked")
                End If
            Next
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to What is wrong with this query logic
    You forgot the asterisk or column name(s)

    Code:
    select top 100 * from
    or
    Code:
    select top 100 sourceSystem_c,ShipViaCode from
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to Calling specific Cell DataGridview
    Are you programmaticall y creating new forms? Think about calling the form based on the cell data and not the cell index. Can you show us your code that you're using o create a new form when a cell is clicked in the datagridview?
    See more | Go to post

    Leave a comment:


  • Simply use the TextBox1_KeyDow n event, with code similar to the following:

    Code:
        Private Sub TextBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
            If e.KeyCode = Keys.Enter Then
                MsgBox("Enter Key Pressed!")
            End If
        End Sub
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to Slow Database
    Is it possible that the client PC has some sort of Anti-Virus which is running real-time scans against the database files when they're being accessed?
    See more | Go to post

    Leave a comment:


  • This is going to sound very trivial, but I would start with the user. Have you confirmed that the problem is repeatable? Are any other users doing the same tasks that this specific user is doing? If any, are those users able to replicate the issue using the same method? Is this the only user working remotely? Does the same issue persist if this specific user is "in the office", so to speak?

    I would definitely stay away...
    See more | Go to post

    Leave a comment:


  • Luk3r
    replied to adding an attempt onto my password
    You have a couple of solutions, but the best solutions are either a Do..While loop or a Do..Until loop. Below are examples of how you would use them.

    Do..Until
    Code:
    Private Sub Form_Open(Cancel As Integer)
    	Dim countLoginTries As Integer = 0
    	Dim totalLoginTries As Integer = 3
    
    	Do
    		Dim password As String
    		
    		password = InputBox("Please enter the correct password."
    ...
    See more | Go to post

    Leave a comment:


  • I think you could benefit from doing something similar to this, assuming your textbox items always have the same format, where the word you want to display is followed by a space:

    Code:
    Dim x As String = lstEbooks.Text.SubString(0, lstEbooks.Text.IndexOf(" "))
    See more | Go to post

    Leave a comment:


  • The syntax should look more like this:
    Code:
    for (row = 0; row >= 10; row++)
    See more | Go to post

    Leave a comment:


  • Since no one has answered I will give you my best opinion. Since it's Access-related, I'm not super fluent, but here it goes. I would think you would add an additional query line that includes whether the record is active or not. Something like this, but again, the syntax is likely incorrect:
    Code:
    Dim dataRow() As DataRow = AMSDataSet.tblITEquipment.Select("AssetTag like '%" & searchString & "%' and Active = 1", &
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...