Search results

  1. T

    How do I reference a Recordset using a variable for the name, rather than a literal

    Thanks, Dave, (Parenthetically, Whitby, our Airedale is currently recovering from knee-surgery, hence a slightly sporadic response to replies!). SecurityFieldName (in my example) is myfield in yours. So I'm trying to use : BrowseRS.Fields - pause for enlightenment to strike! - (SecurityField)...
  2. T

    How do I reference a Recordset using a variable for the name, rather than a literal

    I have a situation where the processing for a particular object class is dependent on: i) Does the class have instance level security, or only class level security and ii) The name of the field where the class keeps its instance level security. Let's explain a little further Imagine two...
  3. T

    Browsing to another form, and passing values

    Thanks to spikepl and Bob Larson for the suggestions. So I've changed the syntax for specifying the form. Here's the revised code for the button that causes the transfer of control to the secondary form: Private Sub cmdSurvey_Click() ' Browse or create a survey for the existing study. '...
  4. T

    Browsing to another form, and passing values

    I'm not certain quite how to express this, but let's take a stab. All forms and controls are unbound. (See below) I have a situation with two object classes (let's call them Studies and Surveys). Each class has an independent existence, but surveys 'belong' to a study. I need to be able to...
  5. T

    Problems using LIKE clause in SQL SELECT

    A quick update. While walking the dog I was thinking about the "invalid data" comment. Even though there is nothing in the combo-box definition to imply that it is a numeric field,. the first field of the SELECT statement references a numeric field. Seems as if MS is taking this to mean that...
  6. T

    Problems using LIKE clause in SQL SELECT

    Thanks, LPurvis, for a clear explanation of why the (wrong) cursor-type was contributing to my dilemma. I've replaced it with adOpenKeyset and, as you predicted, it now reports a valid record count. Myopia, too, contributed to missing the 'False' indications on the BOF/EOF tests. So a quick...
  7. T

    Smart Search/Dumb Programmer - Populating a combo box; Error 2118

    I'm learning by example (and by failure - who ever learned anything from success?) about an Access 2010 combobox. This is an unbound control on an unbound form. and I'm using it to display an increasingly refined set of entries from a table. Just like the thing that Google does when you're...
  8. T

    Problems using LIKE clause in SQL SELECT

    After due chastisement from Spikepl, I have replace the '+'concatenation operator by '&'. The code for the query is as follows (declarations, etc omitted): SQLCommand = "SELECT SampleData.ID, SampleData.LastName, SampleData.FirstName FROM SampleData WHERE LastName LIKE " SQLCommand = SQLCommand...
  9. T

    Problems using LIKE clause in SQL SELECT

    OK - we're one small step forward for ADODB syntax, and one giant leap backwards for results. Here is an example of a SELECT statement that does work: Dim rs As ADODB.Recordset Dim SQLCommand As String Set rs = New ADODB.Recordset Debug.Print "Match wildcard pattern" SQLCommand = "SELECT *...
  10. T

    Problems using LIKE clause in SQL SELECT

    Well, you've made it past the "So quick that I feel like a complete and utter fool" limit! Using a % rather than * certainly returned the right set of data in my test bed. Now onwards to using a 'real world' situation. Thanks, Bob Tony PS Where is this documented?
  11. T

    Problems using LIKE clause in SQL SELECT

    I hate it when there's a quick response ;) but in this case it doesns't help; Here's the more extensive code that I'm using: Dim rs As ADODB.Recordset Dim SQLCommand As String Debug.Print "Unfiltered SELECT!" SQLCommand = "SELECT * FROM SampleData;" Debug.Print SQLCommand Set rs = New...
  12. T

    Problems using LIKE clause in SQL SELECT

    Hi there I'm building a lab db to brush up my SQL. One of the exercises I'm setting myself is to create a SELECT clause that will find all the elements in a table that match a pattern. Here's the SQL command towards which I'm aiming: SELECT ID, LastName, FirstName FROM SampleData WHERE...
  13. T

    FileOpen and FileSaveAs dialogs not available in Access 2010?

    Ain't that the truth though! It's a real pity that the Office development environment is so susceptible to quick projects, and (generally) so robust. If only Open Office offered VBA! Tony
  14. T

    Format function causes compile error in Access 2010

    I wonder if the date-like flavor of your parameters had any effect. The message was "Array expected". OTOH, a year value is pretty scalar in nature, isn't it! Here's the code I was trying to use: ' SurveyIndex now points to the ROW of the entry for this survey ' Create/Update the data for...
  15. T

    FileOpen and FileSaveAs dialogs not available in Access 2010?

    (Hi Michael - did you get here from my rant on Format :rolleyes:?) I have a reference to Microsoft Office 14.0 Object Library, and, indeed, the IDE allows me to create the code. What it doesn't do is to mention that FileSaveAs and FileOpen are no longer available. All that is offered is a...
  16. T

    Format function causes compile error in Access 2010

    Thanks, again, Michael. The issue is not using the range, it is constructing the (address of the) range. So, I can reference a range as wrkSheet.Range("A1") with no trouble. I can even do it somewhat more elegantly by saying: const FirstSurveyThatIWantToExtract="G2"...
  17. T

    FileOpen and FileSaveAs dialogs not available in Access 2010?

    Say it isn't so! I'm trying to select an option for naming a file (Excel spreadsheet) that will contain data exported from my Access database. I'm using Microsoft Office 14.0 Object Library references, but when I try to create a FileDialog, it tells me that: (Actually this showed up when I...
  18. T

    Format function causes compile error in Access 2010

    Thanks for your response, Michael. Hmmm. I wasn't aware that VBA was application specific! Yes - I use format() much more in Excel, but I figured that VBA would still make the function available. It certainly does in the Immediate window, as I noted. All I'm trying to show is that this is the...
  19. T

    Format function causes compile error in Access 2010

    I have a database where I have a need to extract data into an Excel spreadsheet. I am building the spreadsheet but need to construct some range values, using a numeric variable. For example: const IndexCol="A" dim IndexRow as long dim RangeAddress as string for IndexRow =3 to 8...
  20. T

    Navigating within a navigation form

    I discovered the solution to this, so I'm posting it here in the hopes that others may find it useful. First, the general condition within which I am working is that all of the forms used as sub-forms within the Navigation Form are independent forms. In other words they all operate just fine...
Back
Top Bottom