473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

sourceobject set to nothing problem in forms

Hello.

I am using MS Access 97 at work and trying to do the following...
I have a main form which has several combo boxes, 2 buttons (search and
refresh) and an unbound subform on it. This form acts like a search
screen, searching thru a bunch of records using the combo selections as
filters. The search runs when the user makes some selections and then
clicks the search button.

I decided to use the unbound subform for performance reasons. The
sourceobject of the subform is set on the search click event, after the
SQL is assembled that drives the subform.
This all works fine.However...

when I am trying to reset the sourceobject to nothing to clear the
screen (refresh button clears all combo selections and should blank out
subform entirely to prep for another search)
I am getting errors.I am trying to do all this on the click event of
the refresh button which is a control of the search screen so I am
referencing the subform control as

me.mysubformname.sourceobject=nothing

I get an error using the above syntax. I also tried
me.mysubformname.sourceobject=null or
me.mysubformname.sourceobject=""

I also tried closing the referenced subform before setting the
sourceobkect, with no success.
The task is simple, I need to clear the subform when the user clicks
'refresh'. Could anyone let me know why this is not working?

Thanks
JW

Apr 19 '06 #1
4 6146
On 18 Apr 2006 21:01:07 -0700, "joanWilder" <kj*****@rogers.com>
wrote:

You have talent as a suspense writer. Everyone is asking when you will
reveal what error you are getting :-)

I ran the Northwind sample application, opened the Orders form, and
executed this line in the Immediate window:
Forms!Orders![Orders Subform].SourceObject = ""
It worked as expected. How is your code different?

-Tom.
Hello.

I am using MS Access 97 at work and trying to do the following...
I have a main form which has several combo boxes, 2 buttons (search and
refresh) and an unbound subform on it. This form acts like a search
screen, searching thru a bunch of records using the combo selections as
filters. The search runs when the user makes some selections and then
clicks the search button.

I decided to use the unbound subform for performance reasons. The
sourceobject of the subform is set on the search click event, after the
SQL is assembled that drives the subform.
This all works fine.However...

when I am trying to reset the sourceobject to nothing to clear the
screen (refresh button clears all combo selections and should blank out
subform entirely to prep for another search)
I am getting errors.I am trying to do all this on the click event of
the refresh button which is a control of the search screen so I am
referencing the subform control as

me.mysubformname.sourceobject=nothing

I get an error using the above syntax. I also tried
me.mysubformname.sourceobject=null or
me.mysubformname.sourceobject=""

I also tried closing the referenced subform before setting the
sourceobkect, with no success.
The task is simple, I need to clear the subform when the user clicks
'refresh'. Could anyone let me know why this is not working?

Thanks
JW


Apr 19 '06 #2
rkc
joanWilder wrote:
Hello.

I am using MS Access 97 at work and trying to do the following...
I have a main form which has several combo boxes, 2 buttons (search and
refresh) and an unbound subform on it. This form acts like a search
screen, searching thru a bunch of records using the combo selections as
filters. The search runs when the user makes some selections and then
clicks the search button.

I decided to use the unbound subform for performance reasons. The
sourceobject of the subform is set on the search click event, after the
SQL is assembled that drives the subform.
This all works fine.However...

when I am trying to reset the sourceobject to nothing to clear the
screen (refresh button clears all combo selections and should blank out
subform entirely to prep for another search)
I am getting errors.I am trying to do all this on the click event of
the refresh button which is a control of the search screen so I am
referencing the subform control as

me.mysubformname.sourceobject=nothing


Try setting the sourceobject to a valid sql statement/saved query
that returns an empty result.




Apr 19 '06 #3
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote in
news:BQ*****************@twister.nyroc.rr.com:
Try setting the sourceobject to a valid sql statement/saved query
that returns an empty result.


Huh? Sourceobject is the name of a subform or a zero-length string.

There is no reason why setting it to "" should fail.

I don't quite understand why one doesn't leave the subform alone and
just set its recordsource, but it's not my application.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Apr 19 '06 #4
rkc
David W. Fenton wrote:
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote in
news:BQ*****************@twister.nyroc.rr.com:
Try setting the sourceobject to a valid sql statement/saved query
that returns an empty result.

Huh? Sourceobject is the name of a subform or a zero-length string. There is no reason why setting it to "" should fail.

I don't quite understand why one doesn't leave the subform alone and
just set its recordsource, but it's not my application.


Probably what I was thinking when I answered wrong. Or not.

I have seen quite a few applications lately where a single
navigation/menu parent form stays open all the time and forms
are switched in and out of one or more subform controls. Mostly
where an attempt is being made to have an Outlook type menu bar
on the left side of the screen.


Apr 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nathan Bloomfield | last post by:
Hello, I have just changed some functionality in a form which has totally screwed up the subform. form: subfrmLoadsheets subform: subfrmLoadsheetsEquipment (Child/Master - TransactionID) ...
3
by: CSDunn | last post by:
Hello, I currently have an Access 2003 ADP Report/Subreport set up in which I have 12 subreports in a single main report that are located in a group header called 'PermnumHeader' (Permnum would be...
1
by: Krzysztof Naworyta | last post by:
I have read last news, but not found same trouble ... I have a form with subform control used to put in some report-querys ... for example: Private Sub List0_AfterUpdate()...
2
by: Peter D | last post by:
in access 97 on form open i have : Me!frmContent.SourceObject = "frmabout" Me!frmmenustart.SourceObject = "frmmenuaanmelden" '"frmmainmenulist" where frmcontent and frmmenustart are two...
5
by: Bill Stock | last post by:
I'm inherited a database that has a few issues. One of the less severe issues, but the one the users bitch about is the speed across the LAN. So I thought that I could unbind the NUMEROUS subforms...
4
by: Peter D | last post by:
In Access 97 I use Forms!Frmmain!Frmcontainer.sourceobject = "FrmWhateverform" So I don't close forms, i just change the frmcontainer's source. Is there something similar in VB.net? And how does...
9
by: robert d via AccessMonster.com | last post by:
I'm not sure why the following isn't working. The subform loads correctly, but no data is displayed. I'm certain that there is data and I have checked that the SQL statement does in fact return...
6
by: Michael R | last post by:
Please help me with this. I have a form in which I would like to present results from a CrossTab query in a subform. I don't need the query to be bounded to a master field. Also, I have a...
3
Breezwell
by: Breezwell | last post by:
First off, let me say that this forum has provided me with numerous guidance to Access programming challenges I have faced while learning, and I am grateful to all those who share thier knowledge...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.