The programmer is always at fault, but this seems random (1 Viewer)

Riverburn

Registered User.
Local time
Today, 04:26
Joined
Jul 7, 2010
Messages
31
Well, I don't know really what to say about this one:

Here I am thinking I'm doing the simplest job in the world, adding labels. I drag and drop about 3 labels on my form, and name them "comm1", "comm2" and "comm3". I will need them later to show comments but for now, there is no code anywhere talking about comm 1 to 3.

I am of the practise that whenever I do something new, I test it. I add something, I test, I write a piece of code, I test it three times in the middle. it takes times, However my coding-fu has not sufficientely developed yet to write long stretches of code without some testing in between.

at any rate, here I am adding three labels and then testing:

"The Record source "comm3" specified on this form or report does not exist."
usually I can read what an error means. but this one? I have no idea which secret message it holds.
it is true, I do use a recordsource on the form, but that one worked and works fine and is not called comm3.
maybe I shouldn't call it comm ? maybe I misplaced it? maybe access is angry at me for oversleeping? or it didn't like my rant about dates?
I am at a loss :)

Edit: to make matters worse, deleting the offending labels does not help. I have to recreate the form. simply ctrl a, ctrl c and ctrl v does the job, but it does seem like it renames something in my form when I rename the label (and I checked "comm3" does not exist when I deleted it)
 

namliam

The Mailman - AWF VIP
Local time
Today, 13:26
Joined
Aug 11, 2003
Messages
11,695
You gave your CONTROL a recordsource "Comm3" You didnt add a label but a control, is my guess.
 

Riverburn

Registered User.
Local time
Today, 04:26
Joined
Jul 7, 2010
Messages
31
maybe, However the label control had as original Name: "Label12". I changed "Label12" into "comm3" and all went to hell

I did solve it. instead of calling them comm, I'm calling all those labels "labela1" to "labela12". they seem like information boxes for beauty products and not on a comment field for finished assignments, but that's oke, it works.
so it really was the name "comm#" that gave the system a fright. Does comm mean something in access? I haven't called anything else in my project "comm" (used it as a short for 'Comment'), and certainly not my Record Sets which are all called recSetAllAssign, or recSetAllEmp.

oh well, no more comm labels for me
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 12:26
Joined
Sep 12, 2006
Messages
15,696
i have before "renamed" somethnig, and found i was on the wrong control page, and in fact changed the control source.

I would concur with namliam, and suspect you realy have a textbox, rather than a label
 

Riverburn

Registered User.
Local time
Today, 04:26
Joined
Jul 7, 2010
Messages
31
I'd immediately agree with that (although would changing a textbox's name be such a sin?) if it wasn't for the fact that I'd really made sure that the thing I changed was in fact the label.
access wouldn't automatically name anything else besides a label "Label#" and I made sure that the name I did change was in fact "Label#" to "comm#"
and suppose I did change the wrong control to comm3, it doesn't explain why, after deleting my labels and making sure that no control with the name comm3 was on the form that it still insisted that the recordsource comm3 was not present.

I'm going with a funny quirk of Access, because when I changed it to anything else then comm (in this case labela) it did work, and I didn't do anything different.
took me quite some time :) but that's oke it works now, I'm a happy camper
 

Rich

Registered User.
Local time
Today, 12:26
Joined
Aug 26, 2008
Messages
2,898
Deleting a label or control does not delete any vba code associated with them, you have to go into the vba editor to do that
 

Riverburn

Registered User.
Local time
Today, 04:26
Joined
Jul 7, 2010
Messages
31
I assumed vba code was constructed when creating a label, but I don't really know where to look for it :), I wanted to delete it there as well.

However, I still have my doubt wether that is my problem, because that could be the problem if I did create something else then a label.
however, since I remade the form three times, and by the second time made absolutely sure that it was a label and not anything else, I am confident that it won't be that.

However, there is a completely other form that has no connection to this form at all that also has labels called "comm#". that's the only reason I could think of that might cause access to go berserk. but why wouldn't he then do it for the 60 other labels that have identical names ?
 

Rich

Registered User.
Local time
Today, 12:26
Joined
Aug 26, 2008
Messages
2,898
If you've deleted the orinal form then the code goes with it. Open the form in design view then look for the vba code
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:26
Joined
Feb 28, 2001
Messages
27,313
Some confusion all over the place.

First, a control doesn't have a recordsource. It has a rowsource and a controlsource but no recordsource. A FORM has a recordsource, so the properties of the form are involved here. Your form must reference either a table or a query in order to be validly bound. The message says "I am not validly bound because you referenced something called 'comm3' (or whatever name is involved) and I can't use that."

Regarding this particular error, I am guessing but it is at least a semi-educated guess, that when you name something COMM3 that it conflicts with the form's recordsource, perhaps by overlapping one of the names in that recordsource. Renaming the control changes behavior, so the name it had BEFORE you did the rename is the name that is in conflict with another object in your database.

It is also possible that the name is merely ambiguous somehow. That could happen if you had an explicit SQL recordsource for the form rather than the name of a stored query. In the former case, you don't evaluate the contents of that query until the form opens. With stored queries, though, the conflict would pop up when you stored the query from design view. (Still guessing here...)

Just for further clarification, a label control has neither a recordsource nor a rowsource nor a controlsource property. It has exactly one data element, a .Caption property that you can update from VBA, plus the usual .Visible stuff. It some formatting properties like the .Forecolor, .Backcolor, .Bordercolor, .Backstyle, .Borderstyle - otherwise, pretty much as plain vanilla as it gets. But it has an object name. Therefore, the message you get when the label has Commx and you don't get it when the label has another name means that Commx is conflicting with an explicit or implied object ELSEWHERE on the form. Labels are PASSIVE, not active, so cannot do anything dynamic without VBA help.

One last question: What version of Access are we talking about?
 

Riverburn

Registered User.
Local time
Today, 04:26
Joined
Jul 7, 2010
Messages
31
oof, here I thought I was really ignorant about access, not knowing controls might have recordsources. glad to know they don't, and are just like the stuff in Visual Basic, basically single information units with some properties.

all my SQL is explicit (I.e. I don't use stored queries), and no name in them, table name, content name or recordsource name looks like comm, but yea, it must be something there that drives it up the wall.

My version of Access is: Microsoft Access 2003 SP2
which, according to some websites should be a real improvement from 2002. but I already had to delete my printer, restart the project, wasted some hours looking why my dates were screwed up and have this :p
still; I enjoy working in Access 2003 and VB, I might do it more often.

Besides that, two small questions:
1) can I make entire blocks of code in comments. like <Select> <edit> <make comment>
2) I'm almost finished with the project and I think it would be so cool if I could get this project as an executable (that access doesn't need to start) is that doable?
 

dfenton

AWF VIP
Local time
Today, 07:26
Joined
May 22, 2007
Messages
469
Controls do NOT have recordsources -- only forms and reports do. If the error message is reporting a problem with your form's recordsource, then LOOK AT THE FORM'S RECORDSOURCE. Perhaps when you thought you were renaming a control, you were actually in the form's property sheet and changed the recordsource to "comm3" or whatever.

Combo boxes and listboxes, which can be bound to SQL strings, have ROWSOURCES, but that's not involved here.
 

Users who are viewing this thread

Top Bottom