Search results

  1. N

    Eliminate prompts from RunMacro in VBA

    DoCmd.SetWarnings False docmd.runmacro "macro1.name" DoCmd.SetWarnings True
  2. N

    problem with empty fields

    Check the properties of the fields in the tables, not on the form.
  3. N

    Extracting middle initial from text string

    Before walking you through how to run code through VBA, what is your end result for this data going to be? Is it for display purposes, in which maybe a query would work better? Are you updating records to record this information for later use, in which again a query would suffice? If you think...
  4. N

    Import data matching criteria

    Can't you link to the 'master' table, then use an INSERT INTO Query and specify your criteria there?
  5. N

    Extracting middle initial from text string

    Using the Instr and Mid function: Dim FullName As String, FirstName As String, MidName As String, LastName As String Dim lSpace As Long, SplitName As Variant FullName = "James R Brown" 'Find the first space lSpace = InStr(FullName, " ") FirstName = Left$(FullName...
  6. N

    Extracting middle initial from text string

    Are you doing this in a query or VBA? You should research the Mid, InStr, and InStrRev functions. Also you should think about how you will handle people with no middle initial and people with two last names.
  7. N

    IF Function

    What do you mean by 'get no results'? Can you post a subset of the data into a blank database?
  8. N

    AND operator help

    Try this: If Me.txt_PasswordInput <> Me!frm_LoginSubform.Form!txt_Password Then MsgBox "User/Password Incorrect!", vbCritical, "Error!" If Me.txt_PasswordInput = Me!frm_LoginSubform.Form!txt_Password Then DoCmd.OpenForm stDocName, , , stLinkCriteria If Me.txt_PasswordInput =...
  9. N

    IF Function

    ColumnC: IIf(Not IsNull([ColumnA]) And Not IsNull([ColumnB]),[ColumnA],[ColumnA] & [ColumnB])
  10. N

    IF Function

    Just concatenate the two fields together. ColumnC: [ColumnA] + [ColumnB]
  11. N

    SQL Field Error

    What happens if you surround it in apostrophes like below: strSQL = strSQL & "'" & AAField & "', " Likely won't change, but what it seems to be doing is pulling the default property for AAField (in this case Value), rather than entering the actual text (its name).
  12. N

    Change backcolor of 'built' control number

    This worked for me: Dim ctl As control For Each ctl In Me.Controls If ctl.Name = "Label" & DLookup("[ID]", "tblRandomBoxes", "[RandomID] = 15") Then ctl.BackColor = 39835 End If Next
  13. N

    Long Case Select statement - is there a better way?

    You could create a sub that sets those variables and then call that. Public Sub SetFieldValues (sServices as Integer, sDeptID as Integer, sSectionID as Integer, sDeptName as String) Me.ServicesID = sServices Me.DeptID = sDeptID Me.txtSectionID = sSectionID Me.DeptName =...
  14. N

    Type mismatch in expression

    Usually you get that error when you try to join number fields with text fields. I would verify in the design of the tables that the columns you are joining are the same datatype.
  15. N

    Creating text boxes in VBA code

    Be aware that there is a limit to the number of controls you can place on a form. I think it is around 750?
  16. N

    Dates

    We can't help if you don't tell us what you need help with. Post the query and tell us what isn't working/what you are looking for. Extracting a month from a date field is not difficult, but I am not sure if that is what you want. SELECT Month([datefield]) AS [DateMonth] FROM Table1
  17. N

    ACCESS DB File opens and closes quickly

    Did you try opening it while holding down the Shift key?
  18. N

    ms access+mssql tables

    Is your ODBC connection at home correct (ie if you Test DataSource in ODBC connection)? Which authentication method are you using?
  19. N

    Type Mismatch

    Do you have db and rs declared somewhere else in your code? Dim db as DAO.Database Dim rs as DAO.Recordset
  20. N

    converting numbers to words

    Change Pounds to Dollars in the code and Pence to Cents...
Back
Top Bottom