Creating an unbound listbox to be used by code

W

Wabiloo

Hi!

I have an Infopath form based on an Access data connection, that shows
the configuration of the computers on my network.
As I often receive new batches of computers all with the same
configuration, I'd like to be able to copy all the info related to one
computer and create a new record for a new computer from it, rather
than re-entering everything manually.

The way I see it, next to my standard "New Record" button, I would have
another one saying "Copy existing record" next to which a dropdown list
box would give me the list of existing records (IDs). Clicking the
button would trigger a rule or a piece of code that would (for example)
trigger a database function.

However, I don't seem to be able to get a drop-down box unbound to any
of the fields from the main connection...

Any help anyone?

Cheers,

Fabre Lambeau
Inspiration Matters Ltd
 
S

Scott L. Heim [MSFT]

Hi Fabre,

What you will need to do is add the field first to the data source:

- Display the Data Source Task Pane
- Right-click on "myFields" and choose Add
- Provide a name for the new field and data type
- Click OK
- Now when you add a drop-down list to your InfoPath form, you can "bind"
it to this new field that is not a part of the underlying Access data
source.

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Wabiloo

This seems to work. I didn't know that with a main data connection
coming from a database or a web service, I could still have custom
fields. Now I "just" have to create the code behind the button.

Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top