Search results

  1. C

    Combo Box to populate Text Fields via Recordset

    Sneuberg you are a genius!! That worked like a charm!! Here is how made the changes to the code and the cmbvendorstatus populated. Option Compare Database Option Explicit Dim db As Database Dim rs As Recordset Private Sub cmbvendor_AfterUpdate() Dim strSQL As String Set db =...
  2. C

    Combo Box to populate Text Fields via Recordset

    Hey Everyone, I just started to mess around with recordsets and I am having a bit of trouble. I have a combo box linked to a query and that works great. I have a textbox labeled txtid and the rowsource for that field is =[cmbvendor].[columns](1). The combo box is labeled cmbvendor. I...
  3. C

    Update SQL Statement where condition is a number field

    TJPoorman - Thanks!! Work like a treat!! Also thanks for the quick response. Made the change and perfection.
  4. C

    Update SQL Statement where condition is a number field

    Hello everyone, I am stuck on a SQL statement with my where clause being a number field. I created a similar table to test and changed that number field to a text field and the statement works fine then. When I use the original table with the field being a number it gives me a data type...
  5. C

    How to get last inserted id

    I am figuring that out the hard way with unbound forms. Anyway you could share the code or the app for me to review and adapt it for my needs? Thanks
  6. C

    How to get last inserted id

    Hey Pbaldy, Thanks for responding. So the goal that I would like to achieve would be to track the changes made to the fields. So here is how the process works currently: The user selects from a list box and that populates about 10 text / list boxes based on what they picked from the first...
  7. C

    How to get last inserted id

    This is very good and gave me an idea for an audit tracking based on unbound forms. The unbound forms was not my first option as I would have gone with bound forms, but it was what was left for me to deal with now. One day I may change them all to bound forms, but for now I do not have the...
  8. C

    MID Function from Drop Down List

    Hello Everyone, I am trying to write an IF statement that will break apart one drop down list by using the MID Function. Here is the code that I have: If Mid(Me.List23, 5, 3) = "CNT" Then NetworkDate_Click ElseIf Mid(Me.List23, 5, 3) = "CNW" Then NetworkDate_Click...
  9. C

    VBA SQL with SELECT Statement

    Grumm, Thanks for helping me out. After your suggestion it got me on the right track. Below is the code that worked: Private Sub Form_Load() Dim user As String Dim Task As String Dim userLevel As String user = VBA.Environ("UserName") userLevel = DLookup("[calendarname]"...
  10. C

    VBA SQL with SELECT Statement

    Good Evening, I am trying to construct a subform on a navigation form that pulls in a criteria on an SQL SELECT Statement. I am having a hard time with pulling in "Is Null". I want the query to return based on the username and if the other column is blank (no date entered), then have it...
  11. C

    SubForm to open Form based on Column

    Nevermind - I just figured it out. I guess walking away from it did the trick. I added to the query [Audit ID] and made the following changes in the code: On Error GoTo myError Dim varWhereClause As String varWhereClause = "[Audit ID] = '" & Me![Audit ID] & "'"...
  12. C

    SubForm to open Form based on Column

    Hey Everyone, I created a subform based on a few columns. I then created a new form based on a query. I would like to click on one of the columns in the subform and have it open the form based on the item they clicked. Here is what I have done so far in attempts to get it to work...
  13. C

    VBA UPDATE Help

    Hey, I have it figured out. I just made three Variants and added them to my SQL statement and now it works like a charm!! Thanks everyone!!
  14. C

    VBA UPDATE Help

    That code works great, but here is the problem. On the update statement it is requiring that all fields be filled out in order to update it. In my case the user may only update one field. The other two may not need to be updated. How do I change it so that it only updates the field that the...
  15. C

    VBA UPDATE Help

    I got!! Below is the code that worked!! Thank you so much pbaldy, MarkK, and Cronk!! I was missing a ; at the end of the WHERE statement and removing the comma as MarkK suggested did the trick!! Dim strSQL As String strSQL = "" strSQL = strSQL & "UPDATE [travelcalendar] " &...
  16. C

    VBA UPDATE Help

    pbaldy, the yes/no is just a text field. I will copy the SQL into a query and try it. I will report back with my results.
  17. C

    VBA UPDATE Help

    pbaldy: Here is what shows on the debug.print screen. I also made the code smaller easier to read and test. UPDATE [travelcalendar] SET [travelcalendar].[updated]='Yes',[travelcalendar].[newclosingcall]= #03/01/2016#, WHERE [travelcalendar].[ID]=1 **NEW CODE** Dim strSQL As...
  18. C

    VBA UPDATE Help

    Hello everyone, I am stuck on an update query within VBA. I debug.print window and it shows all the data correctly, but not updating to the table. The table name is travelcalendar and the fields I would like to update are: updated (short text) newclosingcall (date/time) newfinalreport...
  19. C

    query in navigation form and subform to display results

    So I was able to figure this out and I took a different approach to it. I thought I would come back here and explain what I did just in case someone else is looking to do the same thing. So the project was to display information based on the username of the user. We wanted to narrow it...
  20. C

    user selects columns to display in query

    Hi Plog, We are currently doing that now with the super users. This is more for the users who have no idea what they are doing. I am more focused on getting the right query for the mail merge then letting users design custom queries.
Back
Top Bottom