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 IamaSherpa 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. cb9002

    Changing text box backgrond colour with function

    Sorted - function now returns the integers from MajP Thank you all.
  2. cb9002

    Changing text box backgrond colour with function

    I have also tried parsing the value within quotes e.g. Me.txtTitle.BackColor = "" & x & ""
  3. cb9002

    Changing text box backgrond colour with function

    Good morning! I am using Access 2003. I have written a function called ChangeColour that returns either vbRed, vbYellow or vbGreen. My code is: Dim x as String If Not (IsNull(comboProbability.value) Or IsNull(comboImpact.Value)) Then x =...
  4. cb9002

    Acessing NTFS Partition on Ghosted Drive

    Thanks for the help. For future reference, no one mentioned that you can't do the above in XP Home unless you boot into safe mode and log in as the Administrators (not any administrator).
  5. cb9002

    Acessing NTFS Partition on Ghosted Drive

    Hi I'm running XP on my laptop. To gain HDD space I bought a new HDD, fitted it and installed XP. The old HDD was fitted into an external USB caddy. Windows won't let me access the old drive - it lets me into the root and windows directories, but not my old personal folders (under the...
  6. cb9002

    Argument Not Optional Error

    Thank you both. MajP, I did do what you said - in my second post below the code above is called as a string. I see what you mean about a query, so if the SQL is not working in the code I can put it directly into a query and debug that way - that makes perfect sense now!
  7. cb9002

    Argument Not Optional Error

    I've tried various combinations including: Me!SurfaceBox Me!SurfaceBox.Value Me(SurfaceBox)
  8. cb9002

    Argument Not Optional Error

    Thanks for your help so far, here's my revised code. DefectType(0) = Surface ... For Check2 = 0 To 5 If Me(DefectType(Check2)) <> "-1" Then NewDefect = "INSERT INTO Defects (Reported, Type, Description)" NewDefect = NewDefect & "VALUES ('" & ReportDate & "'...
  9. cb9002

    Argument Not Optional Error

    tbh all these quotes are confusing the hell outta me! Thanks for your advice so far. I will change the Date field to something else MajP, why is it better (apart from clarity) to phrase SQL statements as variables? I don't understand what you mean, thanks.
  10. cb9002

    Argument Not Optional Error

    Hi I'm using Access 2000 and DAO. I have a form with fields that include "Date" and six categories listed as the array "DefectType". Each category has an associated text box with the word "Box" suffixed to the category name. On submission, I wish to check the contents of the text box for...
  11. cb9002

    VBA Trim Statement Syntax

    OK, I'm using a temporary fix of If IsNull(Initals) but that wouldn't trap a whitespace entry, so it would be nice to know why my code isn't working!
  12. cb9002

    VBA Trim Statement Syntax

    Thanks but I need to trim the string so I pick up null values and blank spaces.
  13. cb9002

    VBA Trim Statement Syntax

    Hi The code below is part on the onclick sub of a form If Trim(Initals) = "" Then MsgBox "Please enter your initals in the box", vbOKOnly Else: CorrectField = CorrectField + 1 End If The idea is, if the text box Initals is blank, bring up the dialog box, otherwise add one to...
  14. cb9002

    Loop not working

    My last message was directed at Remou. Thanks Aceman, I'll try that solution later. I can see how that makes better sense and avoids the array.
  15. cb9002

    Loop not working

    That's great, thank you. This is my first foray into programming since learning C at uni about 15 years ago! I understand now I don't need the x=MsgBox as long as I remove the brackets. Could you explain why you've concatenated the null string at the end of the variable and then used Trim...
  16. cb9002

    Loop not working

    Thanks for that Remou, it got rid of the error but didn't work! The MsgBox didn't come up if the text box was empty. I managed to sort that as you'll see below though. Here's revised code: Option Compare Database Dim DefectType(0 To 5) As String DefectType(0) = "Surface" DefectType(1) =...
  17. cb9002

    Loop not working

    Hi I am a beginner to VBA! I am trying to write a module that checks the content of six unbound text boxes, defined in an array. If the boxes do not contain any content, I wish to prompt the user to enter content. My code is: Private Sub Submit_Click() Dim DefectType(0 To 5) As String...

Part and Inventory Search

Back
Top