Search results

  1. A

    Solved Listbox.Recordset - Column Orders

    Hello Friends, Hope everyone is doing well! I have a listbox on a form that displays data from a ADO recordset. How do we change the order of the columns on the list box? They seem to be ordered alphabetically. Here is the code Dim rs1 As New ADODB.Recordset Set rs1 = New ADODB.Recordset...
  2. A

    Solved Ordering when loop through all the controls on a form

    Dim Fields As Control For Each Fields In Me.Controls If Fields.ControlType = acComboBox Then FieldsOnthisForm = FieldsOnthisForm & "," & Fields.Name & "'" & Fields.Value & "', " End If Next Fields MsgBox FieldsOnthisForm Hello Friends, I am trying to loop through all the...
  3. A

    Solved Referencing a control with a string?

    Hello Friends! Happy Friday and V-Day! The code below is used to change the value of a field to the next one. (Found on Google or possibly this forum, works pretty well) Private Sub Combo385Scroll() [Combo385].SetFocus If [Combo385].ListIndex <> [Combo385].ListCount - 1 Then...
  4. A

    Solved difficulty when highlighting a variable from a long sql query in VBA editor

    Hello Friends! Let's say I have a line of code like this below: Set rs1 = New ADODB.Recordset rs1.Open "SELECT * FROM WHERE [Column1] = " & [Variable1] & " AND [Column2]= '" & [Variable2] & "' AND ................[Column10] = '" & [VARIABLE10].Value &", CurrentProject.Connection...
  5. A

    Solved Run Time Error 438 when calling a sub from another form

    Hello Friends, I am receiving the following error when trying to call a public sub from another form. The code is as below: Forms![Main_Form]![Sub_Form].PublicSubCreated_Click Wondering what possibly went wrong here? I had no problem calling another function/sub within one form but seems...
  6. A

    Solved registering ActiveControl

    Hello Friends! Happy new year to you all! My form has a lot of fields which collect information that is used to calculate insurance premium. I designed the form for user to enter data and ideally when all data is entered, user clicks on a button that runs a macro to calculate the rate...
  7. A

    Solved Displaying the data format

    Hello Friends! I have some fields for user to enter dates. There's two types of fields where one filed's format is mm/yyyy and another field's format is mm/dd/yyyy. The goal here is to ensure user is aware of the date format being used. (mm/yyyy vs mm/dd/yyyy) Is there an efficient way to show...
  8. A

    Changing font color for comments

    Hello Friends! Wondering if VBA editor allows us to change the font color of the comments? By comments I mean the texts after '(single quotation mark) - by default it's green. Thanks! Allan:D
  9. A

    Run-time error "438"

    Hello Everyone! I am getting this error whenever I update a field on a form without having the VBA editor opened. Once I have my VBA editor opened, the macro which gets triggered after updating the field works perfectly fine. Any ideas what would cause this issue? Thanks!
  10. A

    Hello Friends! New member here in Canada

    Greetings from Canada! Hope everyone is doing well! I recently started as a developer mainly working on MS Access. I have very limited experience in VBA so I am look forward to learning from everyone of you. Cheers! Allan
Top Bottom