Search results

  1. P

    Solved Find characters and remove them

    Hello all, This is my first time using the SQL Server side of this forum after using the VBA side for over 6 years :) I am working on a project and need help with a tsql script that will read a string Most of the values are of the form 20R, 20POS, 200R or 200POS or 200.... and I want a script...
  2. P

    Finding the proper Event for Workflow email

    Hello Guys, I didn't know how to word the subject of this thread for future reference but, I want to create a function for workflow emails that will be called rather the Access DB is opened or not. Some background: I currently have a function that sends emails on date conditions but it is on...
  3. P

    Solved Error 13 - Type mismatch when trying to change text box color

    Hello. Any idea why I would be getting error 13: Type mismatch in this block of code? Private Sub Form_Load() If Me.MaxQt.Value > Me.MinQt.Value Then Me.SupplyCateg.ForeColor = vbRed Else Me.SupplyCateg.ForeColor = vbBack End If End Sub
  4. P

    Solved Issue with Null Value

    Hello all, I have a lot of issue with Null Values. Here is the code Private Sub cboRestaurant_AfterUpdate() Dim strSQL As String strSQL = SelectFromQryCateringsWhere & "WHERE RestaurantName='" & Me.cboRestaurant.Column(0) & "'" Me.txtContactName.Value =...
  5. P

    Solved Auto Refresh Linked Table sourced from Excel

    Hello Guys, I want to refresh a linked table sourced from Excel. I found the following code online Public Function RefreshLinks(ByVal sDatabase As String) As Boolean On Error GoTo ErrorOut 'Refresh table links to a backend database Dim dbs As Database Dim tdf As TableDef Dim...
  6. P

    Solved Function returning String not working

    Hi Guys, My function is not returning anything. what am I doing wrong here? Private Sub Form_Load() Dim strSQLLst1 As String ' strSQLLst1 = "SELECT LastOrdered,OrderNo,OrderedBy,SupplyCateg,VendorName,ItemNo,[Brand],[Color],[Size],MaxQt,MinQt " ' strSQLLst1 = strSQLLst1 & "FROM...
  7. P

    Solved Create a FilePath with Year at the end

    Hello Guys, I have create the following file Path which looks for a document in the form LastnameFirstname.pdf strFolderPath = CurrentProject.Path strFilePath = strFolderPath & "\States\" & Me.cboState.Column(0) & "\" & Me.cboName.Column(2) & Me.cboName.Column(3) & ".pdf" However, I...
  8. P

    Solved Run-time error '3061'. Too few parameters. Expected 1

    Hello Guys, Why am I getting error 3061 with this code? I checked all fields name to ensure they match my query and they do. What is the problem? Dim strSQL As String strSQL = "SELECT [SupplyCateg], [Brand],[ItemNo],[Color], [Size], [LastOrdered] FROM QryEmailReminderList WHERE...
  9. P

    Solved Invalid Use of Null Error 94

    Hello Guys, Why am I getting an error with this code? Some of the records do not have an image file path. How can I handle this? Dim strImageSQL As String Dim strImage As String strImageSQL = "SELECT [Image] FROM QrySuppliesDetails WHERE SupplyDetailID=" & Me.lstDetails.Column(0) &...
  10. P

    Auto-populate an MS Access forms with a Website Information

    Hello Guys, I was wondering if there was a way to auto-populate fields in a form from a webpage? For example, let's say I have a vendor webpage and want to grab certain information on an invoice to save in my database. Or maybe save it as a pdf and get the information that way? Is there any such...
  11. P

    Solved Syntax error

    Hello Guys, My code block is meant to add comments to the current comments. Any idea why the "else" block would be red (Syntax error)? Private Sub cmdUpdateComments_Click() Dim strInput As String Dim strComments As String Dim sqlUpdate As String Dim d As Date...
  12. P

    Solved Function result assigned to a listBox Rowsource - Not working

    Hello Guys, I have a Function which is supposed to return a Select statement Here is the function Public Function sqlTaskFName(strControl As String) Dim sqlTask As String sqlTask = "SELECT FName,[State],RegistrationNo,DateExpires,Select1,OfficeID FROM QryPE WHERE [Employee]=strControl...
  13. P

    Auto populate listbox with textbox

    Hello Guys, I am trying to get a listBox to auto-populate or change as I am typing in the textbox. but I type all my selections go away. I placed the code under _Change event AND _KeyPress but nothing. Am I doing this right? I went online to research some codes but I want to believe it is not...
  14. P

    Solved Syntax Error

    Hello Guys, I am trying to familiarize myself with Function in MS Access VBA. Does it not return strings. The following code give me an error message Function getTraining(strTraining As String) As String strTraining = "SELECT DISTINCT [Training] FROM QryTrainedEmployees ORDER BY [Training]"...
  15. P

    Solved SQL/Query <> not working

    Hello guys, I noticed that "<>" has not been working for several of my queries in the query design view and the SQL View. Is there a reason why? I have 2 queries and I want records where the 2 states are not equal but it is returning all the states from one of the query Here is the SQL View code...
  16. P

    Solved Add a number after a Left()

    Hello Guys, I am trying to create an ID based on the first 4 characters of an input. However, I would like to add a number to it each time starting with 1. How can I do that? Here is what I have so far 'Get the new Provider name strNewProvider = InputBox("Please type a new Provider Name"...
  17. P

    Solved INSERT INTO/VBA

    Hello Guys, I have a form with a textbox [txtGrandTotal], which accurately sums a totalPrice every time the form is saved. I am trying to insert that value into a table every time it is updated with the date. I have tried the code on the "After Update" and "Change" events of the textbox but...
  18. P

    Solved SQL/Recordset/Email

    Hello Guys, I am trying to create a email with the body showing all of the person's information. I think I made a mess because not Access is stuck. Here is the code. Private Sub cmdEmail_Click() Dim db As DAO.Database Dim rs As DAO.Recordset Dim sqlStr As String Dim oApp As New...
  19. P

    Solved VBA Date issue

    Hello Guys, I always have some issues with my date functions. I am trying to get a field to turn red if the date is within 2019 but it is not working. what am I doing wrong? and what if I want it to turn blue if we are in the current year? Here is my code Private Sub Detail_Click() Dim curYear...
  20. P

    Run-time error 3021

    Hello Guys, The following code worked in another form and returns a string but I am getting run-time error 3021 from my code. When I step through it sqlDateEarned shows a value but the value is not transmitting to strDateEarned so I am getting the error message. Can you please help me. (It is...
Top Bottom