Search results

  1. J

    SQL Insert Into using VBA with where criteria

    Yeah, this is what I usually do and it works fine in query design, just it's not working in VBA for whatever reason.
  2. J

    SQL Insert Into using VBA with where criteria

    Thanks for the response. strNewTable doesn't exist yet. It's being created with the SQL statement. strSQL = "INSERT INTO [" & strNewTable & "] SELECT [" & strTmp & "].* FROM [" & strTmp & "]" db.Execute strSQL Works fine in creating the new table with data but it doesn't include the...
  3. J

    SQL Insert Into using VBA with where criteria

    Hi all, Been trying to get this piece of VBA code to work but not sure why it isn't. This SELECT statement works fine: strSQL = "SELECT [" & strTmp & "].* FROM [" & strTmp & "] WHERE (([" & strTmp & _ "].[Work center]) Like '*' & [Forms]![frmImport]![txtCode] & '*');" However...
  4. J

    Control Source as a Variable?

    Is there a way to declare a control source as a variable? I have a report filter like this: DoCmd.OpenReport "report", acViewReport, , [site1] = "open" I want [site1] , which is a control source, to change to [site2], [site3], [site4], depending on a value chosen in a combo box. Thanks!
  5. J

    Bounded Columns

    For whatever reason it never occurred to me to launch a small form to do this with a combo box for a selector. I was too focused on trying to do everything from a single button. Thanks for the help, I should be good now.
  6. J

    Bounded Columns

    Appreciate the responses and the patience. I think I'm close in the various stuff I've tried that's been recommended but it still isn't quite working. DoCmd.OpenReport "rpt_install", acViewReport, , "[Man1_AB] = Like '*'&[Enter Name]&'*'" Is what I have. The [Man1_AB] is the control source...
  7. J

    Bounded Columns

    I made a variable and assigned .column(1) to it and it still doesn't work. Can you not use .column(1) in a query criteria?
  8. J

    Bounded Columns

    Thanks for the response. Is there any way to apply this to the control source for a where criteria in a query for the DoCmd.OpenReport? "Me.[Control_Source_of_cbo].Column(1) Like .... " doesn't work.
  9. J

    Bounded Columns

    Hey guys, I have a combo box (Man1_AB) with 2 columns -> ID and name. The combo box is bounded to column 1 - ID. I want to open a report filtering results for the combo box's non bounded column. Is there a way to do this? I know this works for the bounded column: DoCmd.OpenReport...
  10. J

    Report grouping question with 4 input

    Solved this using a union query. Not sure why I didn't think of it earlier.
  11. J

    Report grouping question with 4 input

    Hey guys, What's the best way to do an "Assigned to" report with group headers for 4 variables? A little more detail: 4 workers can work on a task. When the user enters the data, they can put the worker in any of the 4 fields. cboWorker1 cboWorker2 cboWorker3 cboWorker4 All combo boxes...
  12. J

    rst.findfirst problem

    After another hour slamming my head into the keyboard I figured it out. Needed to change to: Set rst = db.OpenRecordset("tbl_hours", dbOpenDynaset) rst.FindFirst "[Hours_ID] = " & Me!txtID
  13. J

    rst.findfirst problem

    Thanks for the response. That makes sense why it always says "1" for the value because of movefirst, but that still doesn't explain why not rst.nomatch is always true, yet it doesn't move to that record when editing.
  14. J

    rst.findfirst problem

    Hey guys, Relatively new in access and programming and having a small problem. I'm trying to open a table and find a record where the ID value on the form matches the PK of the table and grabs that record so I can edit 2 fields. The problem I'm running into is that rst.nomatch is always false...
Back
Top Bottom