data macro set field

supmktg

Registered User.
Local time
Today, 01:50
Joined
Mar 25, 2002
Messages
360
I have a web app form in which I'm using a data macro to update a field in a table. I'm trying to update the field with a short text string that I am building out of other fields in the table. My code looks like this:
Code:
For Each Record in tbl1
   Where Condition = [tbl1].[fldNew] Is Null
      Edit Record
         Set Field
             Name [fldNew]
             Value = "S" + [tbl1].[fld1] + "D" + [tbl1].[fld2] 
End Edit Record

The Macro returns a data error because [tbl1].[fld1] and [tbl1].[fld2] are numeric values and the macro can't concatenate 2 different data types. I can't find the syntax to convert the numeric value to text within this macro.

Can someone help?

Thanks,
Sup
 
I don't use macros, but see if this works:

Value = "S" + CStr([tbl1].[fld1]) + "D" + CStr([tbl1].[fld2])
 
Hi Paul,

Unfortunately, Access Web Apps do not use vba, they are limited to macros that do not recognize vba functions. I have been unable to find documentation that gives me the equivalent macro function to CStr, though I am sure I am not the first to need this functionality.

Thanks for the try,
Sup
 
CStr() is not just available in VBA. I don't know if it's available in a macro, but was worth a try.
 

Users who are viewing this thread

Back
Top Bottom