Page 1 of 1

Html link in subform

Posted: Mon May 02, 2011 5:09 pm
by Fundi
Hi

I'm busy unlearning things from my access past yet trying to come to similar results. nuBuilder is great.

1. How would anyone in nuBuilder take the content of one or two fields in a subform and put it in a third field on the subform or outside the subform.?
In M$-Access you could say Me.Form!Field3 = Me.Form!Field1 & " "& me.Form!Field2

2. What is the best way to put a html reference in a field on a subform so that when the user click on it it will go there. Subforms do not allow html code.

Any insights would help me a lot.
Fundi

Re: Html link in subform

Posted: Tue May 03, 2011 12:47 am
by admin
Fundi,
Subforms do not allow html code.
I think what you mean is JavaScript (not html) and you can put JavaScript on objects in subforms.
if you want something like.

Code: Select all

Me.Form!Field3 = Me.Form!Field1 & " "& me.Form!Field2
HTML is static where as Access can reflet changes as above automatically (like a spreadsheet)
Updating changes on a HTML page needs JavaScript to be run on an event eg. When Field1 or Field2 get changed.

This would be done like this..

Code: Select all

var prefix = nuGetRow();
document.getElementById(prefix+'Field3').value = document.getElementById(prefix+'Field1').value + ' ' + document.getElementById(prefix+'Field2').value;
and would go here...
change.PNG
BUT

This won't automatically populate these fields when the page loads.

To do that you must make Field3 a Display object

with SQL something like this

Code: Select all

SELECT CONCAT(Field1,' ',Field2) FROM tablename WHERE table_id = '#id#'
and put it here..
disp.PNG
There are other simpler ways to do it but they will only show changes after a record is saved.

For little things like this Access is easier to use but in most things nuBuilder is a much faster tool.

Steven

Re: Html link in subform

Posted: Tue May 03, 2011 1:00 am
by admin
On your other question,
if you put this in the doubleclick event of a text object

Code: Select all

window.open(this.value);
it will try to open up any thing in that text field.


Steven