By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

controling the data control

P: 4
I am trying to control my data control box with a combo box. I want the combo box to change the data control's record source. i have tryied to write an if then statement
if cbomoviecategory = action then
datmoviedatabase.recordsource = qryaction
else
datmoviedatabase.recordsource = moviedata
end if

i have tryied other things as well, but i have been unsuccessful.
how do you write code to control a data control's record source
Nov 1 '06 #1
Share this Question
Share on Google+
3 Replies


sashi
Expert 100+
P: 1,754
Hi there,

Under which event did you wrote these codes? Click Event? or Change Event?

I am trying to control my data control box with a combo box. I want the combo box to change the data control's record source. i have tryied to write an if then statement
if cbomoviecategory = action then
datmoviedatabase.recordsource = qryaction
else
datmoviedatabase.recordsource = moviedata
end if

i have tryied other things as well, but i have been unsuccessful.
how do you write code to control a data control's record source
Nov 1 '06 #2

P: 4
i have tried to write the if then statement in side the cbo click event, the cbo change event, and the dat reposition event.
Nov 1 '06 #3

sashi
Expert 100+
P: 1,754
Hi there,

Please provide more details such as partial code segment on your next post. In the meantime try the modified code segment below. Good luck & take care.

Expand|Select|Wrap|Line Numbers
  1. if cbomoviecategory = trim("action") then
  2.   datmoviedatabase.recordsource = trim("qryaction")
  3. else
  4.   datmoviedatabase.recordsource = trim("moviedata")
  5. end if
  6.  
Nov 2 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.