Search results

  1. R

    SQL statement error on certain computers

    > The implication being: If I don't ask, you won't tell why. That's a rather snooty attitute to take, I must say. Snooty? I tell you what I am. I am Norwegian. That is listed in my profile, and has been, I think since I registered here back in 2000. Even though I didn't start with Access until...
  2. R

    Supress Err

    I think perhaps one of the times Undo is available, is when the form is dirty - i e, it has unsaved changes. You could try the following test/action in stead If Me.Dirty then Me.Undo But, what do you do if the record is already saved? The acSaveNo thingie of the DoCmd.Close method, is only...
  3. R

    Difficulty answering questions

    What about turning it the other way around, as long as people willingly do others homework and create whole solutions, is there any reason to expect better phrased questions showing evidence the OP has made some inquiries/searches before posting? I think the standard is set by what we (as a...
  4. R

    excel automation and coloring

    I agree, using the Range method of the sheet object makes more sense here, since that is instantiated and there's nothing else ensuring the correct sheet is used, making the Range method of the application or workbook unsuitable. I didn't see that, I focused only on the column/row thingie. I...
  5. R

    excel automation and coloring

    The Excel Range is often used as this Range("A1").Value = "something" I e, as you do in formulas in Exel, start with the column, then row. appXL.range("B" & lngStartRange).Value = rs("Dest").value
  6. R

    SQL statement error on certain computers

    Using the CDbl function on a date/time, converts it to a numeric, where the integer part, represents the number of days since 12/31/1899, and the decimal part the hour of day, say 0.5 is noon. > No, it won't. I've written MS Access applications that I've deployed to run in US, UK and Malaysia...
  7. R

    SQL statement error on certain computers

    Assigning CDbl(Now) for a date into a string passed to Jet will will barf several places in the world, including where I live. Allen Brownes formatting are safe, the same is ISO 8601 (yyyy-mm-dd hh:nn:ss). Possibly Str(CDbl(Now)) would work.
  8. R

    CreateControl method compile error

    Ah, yes, sorry, actually, it should be enough to enter Tools | TheProject Properties... in the VBE, then change the project name there.
  9. R

    CreateControl method compile error

    Rename the database to something other than createcontrol.
  10. R

    How do you change the name or delete a databast in 2007

    Welcom to the forum. To delete a database, or change it's name, use Windows Explorer, and delete or rename the file.
  11. R

    Best way to empty a variable

    Why do you wish to empty variables? There is really no point in doing so, unless you want to stuff something else into them. The two first, are also meaningless. Assigning "" to a variable of type currency will give run time error 13 - Type Mismatch. The IsNull function is a function to...
  12. R

    SQL statement error on certain computers

    The error you're receiving, doesn't seem to come from the SQL statement you've posted. One tip is to use the following after assigning the SQL string to a variable, but before executing it: Debug.Print str_SQL1 Then you can pick up/study the resulting SQL in the immediate pane (ctrl+g). If...
  13. R

    variable controls???? HELP

    Be careful with your declarations. Str is a function, and therefore shouldn't be used as variable name. Dim TheControlName as string Dim ctl as Access.Control TheControlName = "lblMyLabel" set ctl = me.controls(TheControlName) ctl.caption = "whatever" set ctl = nothing
  14. R

    compare date in vba

    The reason why the original statement didn't work as expected, is that through the Format statement, you converted two valid dates to strings, then you compared those two strings (mm/dd/yyyy) -> "12/01/2007" > "01/11/2008" If the Itm_Date_of_Shipment is a variable of datatype Date/Time, then...
  15. R

    Using a defined variable in an SQL string

    Sqlstr = "INSERT INTO ComputerName (ComputerName, DateField, NumberField) " & _ "VALUES ('" & ComputerName & "', #" & _ Format(SomeDate, "yyyy-mm-dd") & "#, " & SomeNumber & ")"You need to kind of build it like an SQL string looks in the query builders SQL view. Hint, use...
  16. R

    Using a defined variable in an SQL string

    You're welcome!
  17. R

    Using a defined variable in an SQL string

    TrySqlstr = "INSERT INTO ComputerName (ComputerName) " & _ "VALUES ('" & ComputerName & "')"you need to concatenate it's value into the string.
  18. R

    Rounding numbers

    Where are you having these rounding problems? Is it in a table? I'm guessing you have stored your numbers in a numeric field with the field size long integer or integer, which doesn't store any decimals. Check/alter in the tables design view. Depending on the precision you need, you can use...
  19. R

    Can a memo field in different records be combined without SendKeys

    In my second reply, demonstrated concatenation with ADO with this: SQLString = "SELECT TheDate, TheComment FROM TheTable WHERE PersonID = 42" TheString = CurrentProject.Connection.Execute(SQLString, , adcmdtext).GetString(adClipString, , " ", vbCrLf) What is the difference between my...
  20. R

    Can a memo field in different records be combined without SendKeys

    > Without SendKeys I have no idea how to get the contents of the memo field from several records into a single record/memo field. Why would you do that? If you have it properly and relationally stored in one table, why on earth would you "calculate" it and store the same data it in a complete...
Top Bottom