[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How check whether a form is bound to a recordset?

Posted on 2006-07-17
6
Medium Priority
?
333 Views
Last Modified: 2012-05-05
I have a form that I open, then bind a recordset to.

The form's On Current event fires when the form is first opened, before the recordset is bound, and trips an error, since the controls it examines are not yet populated.

How can I write a check to see whether there is a recordset present, to filter out these commands from On Current?

[NB it's possible that the error is due to something else, since only one of several lines in On Current triggers the error:
Me.SectionFinder.Value = Me.Controls("Type").Value
gives error 438: object doesn't support this property or method.]

Happy with an answer to either!

jc
0
Comment
Question by:johnclarke123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 4

Author Comment

by:johnclarke123
ID: 17122693
Sorry - make that runtime error 2424 'The expression has a field, control or property name that Microsoft Access can't find'
0
 
LVL 77

Expert Comment

by:peter57r
ID: 17122708
Hi johnclarke123,

I don't believe you can avoid the errors using this approach.  The fields will show #Error until a valid recordsource is provided.
Why can't you set the form to a valid source and then change it to what you want.
Pete
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 1000 total points
ID: 17122770
Why cant u check if a recordsource is present?

If Me.RecordSource <> "" then Me.SectionFinder.Value = Me.Controls("Type").Value

Is that what u mean?

or the other way is to handle errors

on error resume next

err.clear
Me.SectionFinder.Value = Me.Controls("Type").Value

if err.number >0 and err.number <> 436 then  msgbox err.description


0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 65

Expert Comment

by:rockiroads
ID: 17122773
urm, try 438 instead of 436

0
 
LVL 4

Author Comment

by:johnclarke123
ID: 17122793
That would do it.
Thanks a lot.
jc
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 17122799
Its tweaks galore day today :)

Thats exactly what Ive had to do with cross site scripting Im doing right now. Not exactly a generic solution but it works
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question