Solved A block of HTML code as the Default Value in a Long Text field

alan2013

Registered User.
Local time
Today, 10:31
Joined
Mar 24, 2013
Messages
75
'Tables' seemed the most appropriate section to post this in.

I have an idea about storing blocks of HTML code as the Default Value in a Long Text field (for an application that'll allow me to cherry-pick blocks of code for compiling web pages). And I've been trying it out (placing the HTML code in between =" and " in the Default Value field). If I use fairly bog-standard HTML code (paragraph start and end tags, list start and end tags, etc), this seems to be possible, technically. However, there are some other blocks of code that I'm trying that give rise (when I try to paste the code into th Default Value's 'Expression Builder' and click on 'OK') to error messages. The error messages I've seen so far are :

"The expression you entered has an invalid date value."
"The expression you entered contains invalid syntax. You may have entered an operand without an operator."

I've systematically tried to identify what elements of the code might be triggering these errors, but am getting nowhere with that. For example, one of the error messages mentions an "invalid date value"; but I can't see what part of the code might trigger that error message.

Has anyone had any experience of this, and perhaps know a workaround ?


EDIT :
It might well be that the error message about the 'invalid date' is triggered by font color="#000000". That is, TWO hash-tags and a date or reference to a date field are expected, in the 'Expression Builder'.
 
Last edited:
I have absolutely zero idea of what exactly you are trying to accomplish. If you have a sample, it would be nice. I suspect you are getting those errors because of how you use your quotes. Try to use single quotes within HTML code and double quotes within the expression builder.
 
Usually web developers use an appropriate IDE for developing websites like VSCODE which has the ability to store and retrieve code snippets in the interface as you are creating your html or other code. Not sure why you would do that in Access.

Check HERE or HERE for more info. The second link shows the dynamic expansion of tags on the fly. I really like that feature. There is just no way I would even consider Access as a way to retrieve code snippets when the best modern IDE's already have that capability built in already.
 
"Invalid date value" could be caused by having ## together where they can be interpreted during concatenation operations.

"Operand without operator" could be caused by having a space between two text strings in a context where the concatenation could be evaluated as an expression. (For example, a concatenation action is treated as an expression.)

If this happens where concatenation is occurring, you are probably actually running into imbalanced quoting, including the problem of having some kind of quote mark as data in an unexpected place.

Just remember that VBA's expression analyzer looks at more than just assignment (X = somevalue) statements. It can also step in at any time that it thinks there is a function argument, for example.
 

Users who are viewing this thread

Back
Top Bottom