Recordsets

  • Thread starter Neil via AccessMonster.com
  • Start date
N

Neil via AccessMonster.com

i have a register form which displays mon-fri etc i wish to change the yes/no
boxes so that the user cant tick that box unless the student is registered to
that day, i.e set the box to enabled = false

if something = false then
Me.Monday.Enabled = False
else if somthing = false then
Me.Tuesday.Enabled = false
else if somthing = false

but i need to access the other table(Days) to use in the if statements
problem is how do i access the Days table without changing the record source
to the current table
 
W

Wolfgang Kais

Hello Neil.
i have a register form which displays mon-fri etc i wish to change the
yes/no boxes so that the user cant tick that box unless the student is
registered to that day, i.e set the box to enabled = false

if something = false then
Me.Monday.Enabled = False
else if somthing = false then
Me.Tuesday.Enabled = false
else if somthing = false

Use "elseif" instead of "else if".
but i need to access the other table(Days) to use in the if statements
problem is how do i access the Days table without changing the record
source to the current table

dim rs as dao.recordset
Set rs = currentdb.openrecordset("select * from days where ...")
with rs
if !something = false then
Me.Monday.Enabled = False
elseif !somthing = false then
Me.Tuesday.Enabled = false
elseif !somthing = false
...
end if
.close
end with
set rs = nothing
 
N

Neil via AccessMonster.com

Hello WolfGang,

How would i get the procedure to scan through all the records and update the
fields where days.monday = true then set me.enabled = true etc.
i can make it work by scanning through all the records using nextrecord but i
dont want it to visualy scan down the page through the records

any ideas

Wolfgang said:
Hello Neil.
i have a register form which displays mon-fri etc i wish to change the
yes/no boxes so that the user cant tick that box unless the student is
[quoted text clipped - 5 lines]
Me.Tuesday.Enabled = false
else if somthing = false

Use "elseif" instead of "else if".
but i need to access the other table(Days) to use in the if statements
problem is how do i access the Days table without changing the record
source to the current table

dim rs as dao.recordset
Set rs = currentdb.openrecordset("select * from days where ...")
with rs
if !something = false then
Me.Monday.Enabled = False
elseif !somthing = false then
Me.Tuesday.Enabled = false
elseif !somthing = false
...
end if
.close
end with
set rs = nothing
 
W

Wolfgang Kais

Hello Neil.

Neil said:
Wolfgang said:
Neil said:
i have a register form which displays mon-fri etc i wish to change
the yes/no boxes so that the user cant tick that box unless the
student is [quoted text clipped - 5 lines]
Me.Tuesday.Enabled = false
else if somthing = false
Use "elseif" instead of "else if".
but i need to access the other table(Days) to use in the if
statements problem is how do i access the Days table without
changing the record source to the current table
dim rs as dao.recordset
Set rs = currentdb.openrecordset("select * from days where ...")
with rs
if !something = false then
Me.Monday.Enabled = False
elseif !somthing = false then
Me.Tuesday.Enabled = false
elseif !somthing = false
...
end if
.close
end with
set rs = nothing
How would i get the procedure to scan through all the records and
update the fields where days.monday = true then set
me.enabled = true etc.i can make it work by scanning through all
the records using nextrecord but i dont want it to visualy scan down
the page through the records.

I see! You have a continuous form and want to disable controls in the
details section. That is impossible, because disabling controls in the
details section will affect all details section (for all records).
 
Top