Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

boolean field in a subform

Status
Not open for further replies.

GabberGod

IS-IT--Management
Nov 16, 2003
73
AU
I have a subform which contains a boolean field.

the subform is generated by a query which is reloaded after certain fields
on the main for are updated. The prolem I am having is that when i try to
tick/"select" the boolean field i get the following error:

"An error occured, while referencing the object. You tried to run a vis
basic procedure that improperly references a property or method of an object"


 
How are ya GabberGod . . . . .

Post the code!

Calvin.gif
See Ya! . . . . . .
 
im not bad.

i would if there was code (well there is but i took the code off the field and it still happens)

the code is very simple and works.

Private Sub Allocated_AfterUpdate()
If Me!Allocated Then Me!Job = Forms![Jobs Entry]!Job
End Sub

also the query works that populates the subform also works. but once the subform is loaded I get this problem.

basicly a form has a subform, on the subform there is a boolean field. when it is ticked the code excutes (afterupdate). It all works except i get this warning. can i suppress it. Or can it be fixed? which ever is easier.
 
On further investigation, I dont get the error when i open the subform as a form.

it runs the query, if you manually enter the query arguments (rather than extration from the main form) then it works perfectly. This is starting to seem like a problem with the main form???

what would cuse something like this?
 
GabberGod . . . . .

Hard to say yet . . . . but my first suggestion would be to set a breakpoint at the beginning of the routine and single-step to see exactly where it occurs.

Whats the Error#?

The main forms name is [blue][Jobs Entry][/blue] . . . Yes?

By any chance are [blue]Me!Job[/blue] & [blue]Forms![Jobs Entry]!Job[/blue] bound to the same field?


Calvin.gif
See Ya! . . . . . .
 
Put a breakpoint (F9) at the 1st instruction in ALL the procedures of your subform do discover the culprit.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
ok this is why i hate microsoft,

with a nights sleep and a litle bit of who knows what

it now works when it didnt work yesterday. There have been no modifications to the db since it wasnt working yesterday.

Hence im putting it down to microsoft being crap

thanks for your help guys.
 
GabberGod . . . . .

[blue]Blaming anything or anyone [purple]without proof[/purple] is so extremely unfair![/blue]

As these things go, as easy as it started working, it can stop again. [purple]I would not relax if I were you . . . . .[/purple]

Calvin.gif
See Ya! . . . . . .
 
For subforms you need to add ".Form" or "!Form" (without the quotes) just before the name of the control.

So,

Code:
Private Sub Allocated_AfterUpdate()
If Me!Allocated Then Me!Job = Forms![Jobs Entry]!Form!Job
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top