Hi,
Missing a )
UPDATE table_name SET YourFieldName = IIF(Right([YourFieldName],1) = "," , Left([YourFieldName],Len([YourFieldName])-1), [YourFieldName])
That should work
Simon B.
hi,
I don't see anything right now... but I can give you one trick: always build your query in a string and then pass the string as an argument. You can then do a "Debug.Print strQuery" and troubleshoot the exact query that gets executed...
Simon B.
Hi,
Quotes?
DoCmd.RunSQL "INSERT INTO tblGeneralItems (ItemCode, ItemDesc, Species, SubSpecies, Note) VALUES (04211, 'Chicken Trim', 4, 211, 'Added By Sys');"
Assuming that the data types match I don't see aything else...
Simon B.
Hi
As for the splitting, if your format is always ends with ..., Address, City, Province(?), Postal Code(?), then you can use Split() as DCrake suggested and go backwards for filling the fields (postal code, province, city, etc.)
Simon B.
Hi,
You could do an Update query to correct what is already in your table:
UPDATE table_name SET YourFieldName = IIF(Right([YourFieldName],1) = "," , Left([YourFieldName],Len([YourFieldName])-1, [YourFieldName])
That will "clean up" your trailing "," in your table.
Simon B.
Hi,
That would work although there might be some other way of doing it:
Public Function LastSunday() As Date
Dim myDate As Date
myDate = Date
While Weekday(myDate, vbSunday) <> vbSunday
myDate = myDate - 1
Wend
LastSunday = myDate
End Function
Hi,
Here is what I would do:
Place an input mask on [Forms].[Form1]![StartDate] to make sure the date is entered in the expected format (mm/yyyy).
Then in your SQL:
...
WHERE YTD = Right([Forms].[Form1]![StartDate], 4) & " YTD"
...
HTH
Simon B.
Hi,
You are not specifying any values if the condition is not met. I suppose it will use "null" in that case. Change your IIf to this:
IIf(Left([Field3],6)="00/00/",DateValue("01/07/" & Right([Field3],4)), [Field3])
Hope that helps,
Simon B.
Hi,
Here is the correct syntax:
UPDATE table_a, table_b
SET table_a.x = table_b.1, table_a.y = table_b.b, table_a.z = table_b.
WHERE table_a.xx = table_b.dd ;
HTH
Simon B.
Hi,
In that case modify the function to pass the set as a 2nd argument and use it in the DLookup criteria.
Something like:
DLookup("DecodedTxt", "Table2", "CodeNumber = " & Trim(strCode(i)) & " AND decode_set = ' & strDecodeSet & "'")
You would then call the function like this in you SQL...
Hi,
Do you mean that right now you have 13 decode text with ID 1 (for example)? If so the lookup will get you the first ID it finds and god knows in which order it searches...
But yes it would be possible to have many conditions, perhaps you could include the MVx in your first table and then...
Hi,
This should work:
Public Function Decode(strCodedField As String) As String
Dim strCode() As String
Dim i As Integer
strCode = Split(strCodedField, ",")
Decode = ""
For i = 0 To UBound(strCode)
If Decode <> "" Then
Decode = Decode...
Hi,
Do every user log on their computer with a different login name? If so you could use Environ$("Username") to get the login they used. Then create a table with those logins and their full names to be displayed. The table can also be used to control access to the database (or specific...