473,378 Members | 1,454 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,378 software developers and data experts.

Please could you help me with a tabular form?

I have set up a timesheet for an educational establishment, which has a subform by month where teachers enter times, incorporated into a main form which has their details. The subform is set up as a tabular form, so the teacher can pick date, start time, end time etc. I want to add a learner field which only becomes enabled once the teacher picks a certain value in the function field. I have used the following code:
Expand|Select|Wrap|Line Numbers
  1. If Forms!Staff!August!Function = 8 Then
  2. Forms!Staff!August!Learner.Enabled = True
  3. Else
  4. Forms!Staff!August!Learner.Enabled = False
  5. End If
The problem is: this is enabling or disabling ALL Learner fields in the subform. How do I make it specific to the record being entered?

Thanks.

PS - I am very new to VBA so I am transfering ZXSpectrum BASIC skills. Please be patient with me!!
May 10 '12 #1

✓ answered by mshmyob

If I am understanding you correctly you have a subform and when you change the visibility on the control they all turn off.

If that is the case the subform is working like it should. What you can do is as follows:

1) Ensure the form is set for 'Continuous forms view' not datasheet view
2) Select the control in the subform you want to hide (in this case only disable not hide). I think you have called it Learner.
3) Click on the Design tab at the top of the screen
4) Click on 'Conditional'
5) In the Default formating ensure the enabled state is active.
6) In the conditional section select 'Expression is'
7) Your expression should be something like 'Function = 8' (without the quotes)
8) Click on the enabled button to turn off the enabled state in this section.


What should happen is if the Function control has a value of 8 then the Learner control will become disabled. You may reverse this to have all of the Learner controls disabled by default until a value is entered in the Function control. If it is not an 8 then the Learner control becomes enabled.

cheers,

5 1838
mshmyob
904 Expert 512MB
If I am understanding you correctly you have a subform and when you change the visibility on the control they all turn off.

If that is the case the subform is working like it should. What you can do is as follows:

1) Ensure the form is set for 'Continuous forms view' not datasheet view
2) Select the control in the subform you want to hide (in this case only disable not hide). I think you have called it Learner.
3) Click on the Design tab at the top of the screen
4) Click on 'Conditional'
5) In the Default formating ensure the enabled state is active.
6) In the conditional section select 'Expression is'
7) Your expression should be something like 'Function = 8' (without the quotes)
8) Click on the enabled button to turn off the enabled state in this section.


What should happen is if the Function control has a value of 8 then the Learner control will become disabled. You may reverse this to have all of the Learner controls disabled by default until a value is entered in the Function control. If it is not an 8 then the Learner control becomes enabled.

cheers,
May 10 '12 #2
NeoPa
32,556 Expert Mod 16PB
Why Values in Unbound Form Controls do not Persist may help.
May 10 '12 #3
Hi Mshmyob.

That sorted it and it was so easy!!

Thank you!

NeoPa - Thanks for the advice. This wasn't an unbound field, it was a combo where if the teacher picked one-one teaching (value 8) then they would have to enter the learners name, but I only wanted it if they specifically picked Value 8 because you know how people like to be insane with this sort of thing. If it was always enabled, they would try to put the full class list in!! :-D
May 11 '12 #4
NeoPa
32,556 Expert Mod 16PB
Apologies Lionheart. I did, indeed, miss the point there. Lucky Rob had you covered anyway :-)
May 11 '12 #5
mshmyob
904 Expert 512MB
Good luck with the rest of your project.

cheers,
May 11 '12 #6

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

Similar topics

0
by: MLH | last post by:
When I click new columnar form using form wizard, the form created contains only table fields that are devoid of data throughout all records. Records having data are ommitted. I just noticed this...
0
by: dave k | last post by:
I want to copy data from selected fields in a record on a tabular form (called 'ProductUpdate') to the next record when those two records have a common field - called 'BaseFund' . The selected...
1
by: Himmel | last post by:
I may be brain-fried, but I could use some help again. One of my glorious forms in my multi-form report thingiemajigger is a tabular form. For example, it shows customer items purchased and the...
2
by: Richard | last post by:
Help please. I am trying to autofill a form text field from a select-box lookup. I have no problem doing this if the select-box is part of the form but because there are 5 possible select boxes...
1
by: NewtoAccess | last post by:
I have a Tabular form and want make it 'look like' a list box. I dont want the scroll bars to be visible AND do not want an empty row at the bottom (to enter new record information). Is this...
2
by: ShadowHawk | last post by:
Hi Everyone. I've been having a little touble with a form I'm working on. (I'm a MS Access hobbiest). I've set up the cascading combo boxes, which is working, (I took the code from Microsoft) on a...
5
by: Hassan Darwesh | last post by:
i want to make tabular form like in MSaccess to show records from table in mdb database .. it's alredy in MSaccess but i wanna ues it in vb6 .. i tray to find ocx to do that but i didnt find any ...
5
by: geebanga88 | last post by:
Hi i just created a form using wizard in tabular style. Normally i would be able to edit each record in the table but i cant? I have set allow edits to yes and data entry to yes as well. Is there...
2
by: sam12 | last post by:
HI there i have this kind of employee list form in my database select flag first name lastname dob x xxxxx xxxxxx xxxxxxxx x ...
2
bard777
by: bard777 | last post by:
I am creating a project management DB for our company. I have a project form that has a requirements tabular subform. I want to change the due date textbox to red if the sue date has pasts. I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.