Setting control source for an object

darkmastergyz

Registered User.
Local time
Today, 07:12
Joined
May 7, 2006
Messages
85
I'm trying to set the control source of a text box, but I don't know the syntax for it.

me.txtLabel.controlsource

That's as much as I have. I need it's control source to be set to the 3rd record in a table "file". That table isn't the form's record source. How can I do that? Thanks.
 
You've started like five or so threads asking questions that could have been answered if you'd only...

RTFM.
 
I really did read the manual. I couldn't find anything on this. Most of my questions are answered in it. This is one of my last questions in a problem I'm having. Thanks!!
 
this was tricky, but by typing 'controlsource' sans apostraphes into the search box in the upper right hand corner of vba i got this:

Code:
Forms!Customers!AddressPart.ControlSource = "City"

in your case this might translate to something like, tables![file]!field3 = me.txtlabel.controlsource.

or perhaps its inverse
 
it gives me an error though: 424 (object required). I tried connecting to the database that way though.
 
With CurrentDb.OpenRecordset("yourtablename", dbOpendynaset) ?

and did you try it this way?

me.txtlabel.controlsource = tables![file]!field3
 
That still doesn't work. Did you try it? Can you post a code sample of it, because it's not working for me. It's still a 424 error, and it says "object required" over the tables![...] expression during the break analysis. Putting it into a recordset might work, but when I tried it, it didn't, unfortunately. As I said, the recordsource of the form is different than the control sources of this text box.
 
Last edited:
is the form bound to the alternate record source through access properties? because if so i think that might be where your problem is.

you should be able to open multiple rs through VB, but if you want a bound form, you may have to add a subform to include controls bound to another box.

you should lay out what you want to be doing a little more clearly, and maybe we can get some experts up in here. remember vague questions get vague answers...:D
 
Sorry for being so vague. So basically, I'm going to break it down fully. I have 2 tables:

tbl1:
ID| Song |

tbl2:
PriKey | ID (which is linked to tbl1's ID, except this is nonunique)| lyrics

basically the lyrics are links to image files (i have them scanned), and there are multiple lyrics pages for each record. The PriKey is almost useless, and only the ID is important, in order to determine which "song" in tbl1 it's connected to. If you don't understand this, please let me know, I'll gladly expand.

So when I look at tbl1, I get a "+" at the front of the record, letting me expand it to see the lyrics assosiated with it.

My problem is I want to display text boxes which display a link to an image file for each of the ID's Lyrics. So I'll be on one record ID (in tbl1), and I want the text boxes to be connected to tbl2's lyrics. They need to control tbl2, but the whole form's recordsource is tbl1. I hope that makes sense.
 

Users who are viewing this thread

Back
Top Bottom