Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    Hey dhookom, Yes, I hear you. Just FYI, I'll describe below. My database design requirement is pretty easy to describe, but much harder to implement. As an engineering design progresses on an industrial project, many people have access to my design database. Using the forms I created they...
  2. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    Partially, yes. I am now able to filter my record source to just one record. This was my first challenge. My code was originally made to run and populate tables when no forms were open. I will now need to adjust my code to essentially do the same thing while a form is open. (I need to get...
  3. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    Hey dhookom, Hallelujah !!! Thanks for your help. The code is executing now without the main form reference. This was my fix: strBase = "SELECT * FROM [qryIS-1] WHERE Link1 = """ & Forms![frmIS-1c]![subfrmIS-1a].[Form]![qryIS-1.Link1] & """" strVarying = "SELECT * FROM [tblqryIS-1c] WHERE...
  4. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    You are correct, qryIS-1 is a record source and not a database. It is my 'live' data. The main form name is frmIS-1c. Its Record Source is tblLoop. The subform on tab 1 is subfrmIS-1a, and it's Name and Source Object are the same "subfrmIS-1a". The Record Source for subfrmIS-1a is qryIS-1a...
  5. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    The code is in a module. Tab 2 has subfrmIS-3-Chng. The On Enter event for subfrmIS-3-Chng calls a macro which runs a function that calls the code. What is working so far is when I click the tab, the code begins to execute. But it stops with the error 'External name not defined'. What is not...
  6. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    Thanks dhookom, I have fixed the sql to FROM [qryIS-1a]. [qryIS-1a] is the data that my subform [subfrmIS-1a] is based on. Using the Expression Builder I added a control on my main form for the subform with its Control Source as =[subfrmIS-1a].[Form]![qryIS-1]![Link1] but I only get #Name...
  7. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    I've updated my code with dhookom's suggestion to just build an SQL statement for the recordset. I caught some referencing errors and fixed them. But, now I get the error 'External name not defined' when the execution gets to line with first reference of [subfrmIS-1a]. To clarify my querys...
  8. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    Thanks dhookom and hermanlaksko for your suggestions! I'll have time later today to work on them. I'll let you know what happens.
  9. Bubba002

    WHERE clause in the Set command of an db.OpenRecordset method

    I currently have code working to create a report on an entire database capturing all the changes in the current (live) database from a historical (aged) table of the same database. The problem I’m having is that as the day goes on, the report becomes less useful, as it too is “aged”. I...
  10. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Hey dhookom, Eureka!!! It's working, red for first time new data, and red for changed data! Thanks so much for you help! Rather than using one CF command based on multiple conditions, making two CF condition commands works perfectly. I did some quick testing as it is a subform, and it works on...
  11. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Hey dhookom, Sorry, To clarify: Live = qryIS-1 Aged = tblqryIS-1 I'm looking for Null in tblqryIS-1 (aged) data. Basically, as new engineering data is entered it gets red. First time 'new' data is looking at 'Null' and should be red. Subsequent 'new' data is looking at 'Not Equal' and also...
  12. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    I tried ”IsNull([" & strTB2 & "])" but I get error ‘Expected: end of statement’. What I am learning is that expressions are not intuitive and do not return what I might expect. The following works for getting red: ctrl.FormatConditions.Add acFieldValue, acNotEqual, "[" & strTB2 & "]" The...
  13. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Hey dhookom, Your are correct, IsNull(Me(strTB2)) does return True or False. I understood that is what makes the text red or not. When hard coding, the two rules that worked are: Value <> [tblqryIS-1c.Signal] Expression Is IsNull([tblqryIS-1c.Signal]) So far, these vba CF rules are working...
  14. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Yes, email your demo file and I’ll take a look at it. I seem to be sooo close. I’ve been busy using F8 and stepping through most of today. I can tell what part of the If statements are running. I can see the values for the ctrl.FormatConditions(0).Modify and ctrl.FormatConditions.Add...
  15. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Thanks for your code examples on how to reference values/controls based on names stored in strings! I have that working now. I just tried your code exactly on a test database and form, but it is not turning red. I checked the underlying data to be sure. Also, the Me(strTB2) is not bringing...
  16. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    I have been using the debug.print line, I just moved it down where the code is working. I can get strTB1 and strTB2 printed correctly. I have tried to get their values to print using the following syntax: Me.Recordset("fieldname") from this guidance: Me.Recordset("fieldname") should work. And...
  17. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Hey dhookom, I'm getting much closer. I use ControlSource rather than Name because Name includes the Labels, and I'm just looking at the data controls. With that, I had to update my prefixes. In debug I can see all 5 'strFieldName' variables as well as strTB1 and strTB2. Both the .Modify and...
  18. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Hey dhookom, I've tested several times and still don't get the changed text to turn red. I debug the code below but can't seem to get a breakpoint to work inside the 'If' statement. I addded variable strFieldName and confirmed that the code correctly proceeds thru all controls (live & old)...
  19. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    Thanks dhookom, yes I will do some testing. I need to study a bit more, but I see how it should work now. Thanks again for all your help. Bubba002 Technical User
  20. Bubba002

    Pass a subform fieldname-ID as a string variable in CF expression

    The controls on the subform are only for the live data (qryIS-1). The aged data is not shown, but is only l-i-n-ked to be able to be available in the recordset. To keep the code tight and efficient, could I change the code to only CF the live data controls? (The aged data is archived and will...

Part and Inventory Search

Back
Top