Search results

  1. LPurvis

    Add blank line to listbox in Access 2007

    It looks to all the world that you have multiple columns. If you do then it's only appropriate to add values per column - even in the AddItem method by concatenating the values with a semicolon separator. If you were building the RowSource property string entirely manually you'd have to do the...
  2. LPurvis

    SQL Syntax error in VBA/Access

    We need to go back and be way clear here. What are you actually trying to do. It looks clear that there's been a misconception. The first of the two options I suggested looks like it isn't what you really want. I will reiterate again... You build a SQL statement. It must be a string which is...
  3. LPurvis

    SQL Syntax error in VBA/Access

    Well, you really need to know what it is you're executing. Standard debugging practice has you output the SQL statement to the immediate window. After your line of code. strSQL = " SELECT DISTINCT " & rs_tw!Field3 & " FROM " & rs_tw!Field3 & " WHERE " & rs!Field3 & " Like '%/" &...
  4. LPurvis

    SQL Syntax error in VBA/Access

    strSQL = " SELECT DISTINCT " & rs_tw!Field3 & " FROM " & rs_tw!Field3 & " WHERE " & rs!Field3 & " Like '%/" & Me!txtaspectratiovalue & "R%'"
  5. LPurvis

    SQL Syntax error in VBA/Access

    That's not what I just posted though. (I posted a correction of your code as it stood. You were missing an ampersand - and still are missing it.)
  6. LPurvis

    SQL Syntax error in VBA/Access

    An error? That matters not so much. What error - matters much. :-) strSQL = " SELECT DISTINCT " & rs_tw!Field3 & " FROM " & rs_tw!Field3 & " WHERE " & rs!Field3 & Like '%/" & Me!txtaspectratiovalue & "R%'" This concatenation and the clone method are totally separate options. If one is...
  7. LPurvis

    SQL Syntax error in VBA/Access

    Does the first recordset contain table and field names? Or are you actually trying to open a second recordset based on the first as its source? You can't do the latter (recordsets are in memory code objects - which aren't within the scope of the database engine - which is what you're always...
  8. LPurvis

    Key Press Question

    Well it was a slight assumption - but a common one when redirecting key combinations to another action. It basically cancels the UI action that raised the event. So in this case, since Ctrl X would normally cause a Cut, it cancels that action and performes the code based alternative only. It...
  9. LPurvis

    David Crake – very sad news

    I've only just realized, but wanted to say how sorry I am to hear this. Desperately sad news. Much too young with plenty still that he would have achieved I'm sure (beyond the substantial amounts already accomplished). My thoughts are also for David and his family.
  10. LPurvis

    Key Press Question

    Hi You'll want to set the Form property "Key Preview" to true (Yes) and then something like... Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 88 And Shift = 2 Then 'Ctrl x pressed DoCmd.CancelEvent Me.txtBoxName.SetFocus End...
  11. LPurvis

    Passing parameter to SQL Server stored procedure

    SQL Server Express is pretty good value! ;-) (Though free isn't always good - it is in this case.)
  12. LPurvis

    Function / combo box

    No worries. Glad to hear you're pushing yourself forwards. It just shows that even after a long time living within a certain status quo, it's never too late to break free and start a new chapter! I'm sure you'll do fine. (You seem more than sufficiently eager to learn - I can't think of...
  13. LPurvis

    Function / combo box

    The control at which it errors just won't have a backcolor property. How can that be? Your check is close, but not quite there. If Cont3.ControlType = acTextBox Or acComboBox Then Let's suppose that as the collection is enumerated, the control is a command button. Thus you get...
  14. LPurvis

    Using multiple RunSQL statements

    I'm still not clear on what you're doing. Can you give a concise but full indication of your actual table structure? And what the data is like - and should become? Cheers.
  15. LPurvis

    Creating a description of a table

    I'd thought about mentioning that in the previous code - but figured it must be understood to have been used, but the code could have come from anywhere - therefore the problem with the change in concept now. The earlier code: Set tdf = db(strTableName) is assuming the default collection of...
  16. LPurvis

    SQL Syntax error in VBA/Access

    Hi strSQL = "SELECT TOP 10 [Field3], [Field7] FROM List WHERE [Field3] Like '%" & Replace(Me!txttirewidthvalue, "'", "''") & "%'" Not everything there is compulsory but I'd recommend it. If you can avoid the leading wildcard - you can better optimisation (very much so if Field3 is indexed)...
  17. LPurvis

    Creating a description of a table

    Hi Create and maintain a Database object variable for use when instantiating your tabledef. i.e. Dim db As DAO.Database Dim tdf As DAO.TableDef Dim prp As DAO.Property Set db = CurrentDb Set tdf = db(strTableName) See this When to use CurrentDb and when to set a...
  18. LPurvis

    Using multiple RunSQL statements

    Hi It would depend hugely upon what you mean by "move to the next line". Are you referring to the [Per Data Birthday] field value increasing? Or something else entirely? Cheers
  19. LPurvis

    Function / combo box

    Oh I just know you can figure this out. As you can tell - it centres around this one line of code: If Cont3.ControlType = acTextBox Then 'Checks to see if a text box You only need to include the option of a combobox as well. Include implies an OR statatement. So instead of If Then... it's If...
  20. LPurvis

    Passing parameter to SQL Server stored procedure

    Hi... Welcome to AWF. It'll likely have been hard to interpret previous questions on this subject with your scenario. They key concept here is that you're using an Access Data Project (ADP). Therefore executing stored procedures are pretty simple. The connection of the current project points...
Back
Top Bottom