Hello everybody
I have a similar question to the one that was posted with the title of my question on december 21 2006. But my situation is a bit different.
I am working on a database which contains persons who participate on different seminaries during a specific period of time. After each seminary they receive a diploma if they were not missing more than for example have a day of the seminary.
On my access form, I can select/connect each person with multiple seminaries. For each seminary I can write in a txtfield the number of days a person was missing in this seminary. What comes next is that I have a Checkbox for each seminary(diploma received yes/no). I would like (for each seminary) that the Checkbox is blocked if there is written anything in the txtfield mentioned before. The Checkbox shall only be activated if the txtfield is empty.
I tried to do it with this VBA-Code:
Private Sub B_Absenz_HT_AfterUpdate()
If Not IsNull(Me.B_Absenz_HT) Then
Me.B_Diplom.Locked = True
Else
Me.B_Diplom.Locked = False
End If
End Sub
It works, but not for each seminary separately but only for all the seminaries together, which is not convenient.
I would be very happy if somebody could tell me how that I can change this VBA-Code so that it only connects with one single seminary.
Thanks a lot!
Mike
Hi Mike.
If this doesn't solve the problem, I would certainly suggested posting it under "Access"
I think what you have got is fine, assuming the Zertificat on your form is bound to the B_Diplom in your table.
I think what you are missing is to lock and unlock the B_Diplom on the OnCurrent of the subform -
Private Sub Form_Current()
-
-
If Not IsNull(Me.B_Absenz_HT) Then
-
Me.B_Diplom.Locked = True
-
Else
-
Me.B_Diplom.Locked = False
-
End If
-
-
End Sub
-
I just have a suspicion from your first posting that you may not have B_Diplom as the ControlSource of Zertificat.
Phil
4 6239
Firstly, Mike, this question should have been posted under "Access", not "Desktop Software" which is why you are getting no answers.
So what is your table structure?
Is this a form based on the students and a subform for the seminars?
Is the checkbox bound to a field?
Phil
Dear Phil
Thanks a lot for your answer and for the information about the post. Now I understand the reason why I don't get answers. Do you think I should repost it under "Access"?
I link two documents as an attachment. One with the table structure and another with the form structure. My wish would be (please have a look at the form structure) that if there is written anything in the field "Absenz (HT)" or "Absenz Grund" that the Checkboxes "Zertifikat" AND "Eintrag Ausbildungspass" are blocked and vice versa.
Thanks a lot for helping me. If you need more information, please let me know.
Mike
Hi Mike.
If this doesn't solve the problem, I would certainly suggested posting it under "Access"
I think what you have got is fine, assuming the Zertificat on your form is bound to the B_Diplom in your table.
I think what you are missing is to lock and unlock the B_Diplom on the OnCurrent of the subform -
Private Sub Form_Current()
-
-
If Not IsNull(Me.B_Absenz_HT) Then
-
Me.B_Diplom.Locked = True
-
Else
-
Me.B_Diplom.Locked = False
-
End If
-
-
End Sub
-
I just have a suspicion from your first posting that you may not have B_Diplom as the ControlSource of Zertificat.
Phil
Dear Phil
Thanks a lot for your help, it works!!
You are a genius, thank you!
Mike
Sign in to post your reply or Sign up for a free account.
Similar topics
by: jochen scheire |
last post by:
Is there a way I can calculate a field in a form based on another field in
the same form. When clicking submit, both values should be posted to the
next page. I want to be able to type in a value...
|
by: Greg |
last post by:
I am trying to change the value of one field in my query based on the value
in another. If Field 1 had the text "ONACCNT" then in Feild 2 I want the
date to change to today's date. Any help would...
|
by: john_liu |
last post by:
I have a field called AMOUNT in MS Access with values of 10, 20, 30, 40, and
I want to create another field called TOTAL like this: if the value in field
AMOUNT=20, then TOTAL=AMOUNT*3, else...
|
by: compl |
last post by:
I have a database that I need to restrict the ability to edit one
field based on another. The two fields are DOS (date) and Amount
(currency). I only want the users to be able to edit the Amount...
|
by: yesgirl |
last post by:
Hello,
In an Access 2003 form, I have a combo box that offers numerous selections. If certain values are chosen (i.e. "Done") then a date in another field in the form must be entered...
|
by: Coll |
last post by:
I have a field that I would like to display on a report only if the
value of another field matches a certain criteria. If it does match I
need the label & the field value to display (though I'm...
|
by: PowerLifter1450 |
last post by:
Hi all, I have to Combo boxes on a form. The first one I would always
like users to see. The second, however, I would like hidden if the
first box has certain values selected. So, if ComboBox1 has...
|
by: MyWaterloo |
last post by:
Ok.
I have a form with a field for a sampler's name, number, and email address. The sampler's name is selected from a combo box that references a table with name, number, and email. I want to be...
|
by: clloyd |
last post by:
I have a phone number field (BusinessPhone) that I only want to display in my query results if the user has selected yes (yes/no field) in another field (Business Y/N field).
The premise is that...
|
by: jolaunt |
last post by:
I am trying to create a vba code to tick a box after an update of another box.
I have a yes/no drop down box called 'ResolvedByTelCall'. When 'yes' is selected I want a tick to go in another box...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
| |