I am just starting to use designer and with some stumbles along the way have perfected the layout of the form I am trying to create. The next step is connecting it to a Microsoft Access database. However, I am having some problems.
I have looked everywhere imaginable for a "how-to" on connecting an Access database to my form in Designer. I have gone through setting up data connections several times, all with the same result: "Connection for Source NPIF failed because the environment is not trusted". NPIF is the name of the data connection I've been trying to set up.
I realize this is probably a very boring problem to solve, but I am desperate! I have not seen any answers to other posts asking this same question, so I'm worried this one will be overlooked too. Please, there are many of us out there who cannot figure this out! Help us?
Other people seem to have set this up with no problems. Maybe one of you can post the steps you took to get it to work - share the love!!
Sorry it took me a while, but I was out of town yesterday. Hopefully, we can get this working today though!
The drop down box is supposed to have the Clients from my database in it. Yes, it is one of the fields I dragged over from the data connection. In the Access DB it is a regular text field. When I click on the arrow in the PDF nothing happens. Nothing drops down. Is there a problem with the connection?
Thank you for your help too. I checked out that article and went though the steps listed and I am also getting a sytax error which says there is an illegal character in the SelectField Initialize script. Is that the same one that you're getting? Have you figured out how to fix it?
I have made a copy of the form and am attempting both ways you guys have suggested. So far neither of them are working yet. Where am I going wrong??
Hmm.. I'm surprised that dragging a field from the data view would create a drop down list instead of a text field since that will never work without script. Try replacing that drop down list with a Data Drop Down LIst (from the custom tab). Modify the script so that:
sDataConnectionName holds the name of the data connection
and sColHiddenValue and sColDisplayText hold the name of the column in the db.
Elizabeth, yes, you need a script to make to get the proper results based on the selection in the drop down. Take a look at the form that Dan links to above, the script on the refresh button does exactly that.
Dan, can you post the complete string of code. Maybe I can decipher it. Or can you put your form online somewhere? I didn't see this when I downloaded the form earlier.
I copied out the button and formcalc from the link and changed it to my field names. When I click the refresh button the mouse changes to an hourglass for 30sec - 1min, but then nothing gets filled in. If I click the button a second time, the button turns blue but still nothing gets filled in.
This is the formcalc on the click event of the refresh button:
if (Len(Ltrim(Rtrim(ClientName.rawValue))) > 0) then
$sourceSet.DataConnection.#command.query.commandType = text
$sourceSet.DataConnection.#command.query.select.nodes.item(0).value = Concat(Select * from Clients Where ID = , Ltrim(Rtrim(ClientName.rawValue)) ,)