Search results

  1. M

    Sorting field names in code

    Before I embark on writing something to do this, does anyone know of a way to sort the field names (not the field contents) so that in Table Design view, they are sorted alphabetically? For example, these fields: LName FName Addr1 Addr2 City State Zip Phone Email Would become this in table...
  2. M

    Set value to True in code (Novice)

    CurrentDb.Execute "UPDATE YourTableNameHere SET Validated = True WHERE BatchID = " & Forms("BatchResultsEntry").Form.Controls("BatchID") Replace YourTableNameHere with the name of the table where the field Validated is.
  3. M

    Random Number Format

    To prevent the error, do a DLookup on the the table, looking for your number first. If DLookup returns zero (no matches), then write the number to the table. If DLookup returns a one, it's found a match, so rerun the randomize routine, check for a duplicate again, etc. Quick rundown: 1)...
  4. M

    Import/Link Outlook Tasks into Access

    Instead of the very limited wizard, connect to Outlook directly, and you can pull all the data. Pseudo-coded so you get the idea: Dim OLApp As Outlook.Application Set OLApp = New Outlook.Application Then, through the OLApp object, you can get everything from Outlook that you want. Use...
  5. M

    Control properties not fully exposed upon creation

    Good call. I was coming back to post that that's exactly what I did. Thanks for the response. :)
  6. M

    Control properties not fully exposed upon creation

    I have an issue whereby all of the properties of a field are not exposed at the time the field is created. This isn't really a problem, but more of a nuisance. For reasons I won't go into now, we have to set the DisplayControl property of a Yes/No field in a table to be Check Box. This is...
  7. M

    Compact Secured Database

    Glad you found the hotfix (and bothered to look for it). That's the sort of initiative everyone asking questions in here should display! :) And yes, the SP3 hotfix solves all sorts of bizarre, seemingly unrelated problems that SP3 brought with it.
  8. M

    Checkbox issue

    I'm getting to this today. Give me an hour or so.
  9. M

    Joins

    I'm sorry, but with the abbreviations, I can't make out what you mean. You're trying to do something simple, but it's being complicated by a lack of detail here. Can you post the DB?
  10. M

    Undoing changes

    Recordsets don't properly close when a sub ends, and globablly declared ones need to be cleaned up as well. rs.Close Set rs = Nothing Do that for each recordset you want to close and destroy. Skip the Set rs = Nothing to leave a recordset instantiated but in a closed state. That way, you can...
  11. M

    [access 2000] 7 lines that are killing me

    There it is. Change this: Set sUser = GetWinUserName To this: sUser = GetWinUserName You don't have to set a string. If that's not it, please say what line it's stuck on (as pbaldy suggested).
  12. M

    [access 2000] 7 lines that are killing me

    Post the code for GetWinUserName. It sounds like it wants something passed to it. And, we may be able to replace it completely.
  13. M

    Combo box/Listbox Help

    You had no opening quotes, so you don't need closing quotes. Changed this: SELECT ListboxQry.CName, ListboxQry.Description, ListboxQry.SCAC FROM ListboxQry WHERE [SCAC] & '"=[Combo2] & "'" To this: SELECT ListboxQry.CName, ListboxQry.Description, ListboxQry.SCAC FROM ListboxQry WHERE...
  14. M

    Mail Merge: MS Word Cutting off Text

    Not a problem. :)
  15. M

    Combo box/Listbox Help

    And is column 0 (which is bound column 1) in that combobox the SCAC value or something else? What is the RowSource value for the combobox in question? This is a little confusing because the column index is zero-bound while the bound column is one-bound. What this means is, if you have a...
  16. M

    Enumerate ALL List Box items

    A for/next loop is an incrementer, as it were. Therefore, in this statement: For x = 1 to 5 Debug.Print x Next The immediate window (press Ctrl-G in the code window to open this) will show you this: 1 2 3 4 5 What's happening here is that X takes the initial value and it keeps that...
  17. M

    Combo box/Listbox Help

    What is the bound column for the listbox? If it's numeric, you need to lose the single quotes, like this: SELECT CName FROM [SP Data] WHERE SCAC = " & [cboSCAC]
  18. M

    Combo box/Listbox Help

    Delete the bolded red quote: Me.List38.RowSource = "SELECT [SP Data].CNames FROM [SP Data]" & _ WHERE [SP Data].SCAC = " & me.Combo36"
  19. M

    VBA Reset

    Also, note that we are giving Excel examples, but this is true for most external applications. I know you need to do this in Word as well. I don't know if it's just Office applications, but if you start coming across this weird error with other applications, explicit declaration will probably...
  20. M

    Cool Search Tool Recordsets

    For now, just delete the module named "username" as I replaced it with the Environ() function. As for other things, they're more stylistic. It looks like you've copy/pasted a lot of code from various examples, and that's fine for beginners. The trick is to understand what the code is doing...
Back
Top Bottom