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

Check box automatically checked if certain fields in the table contain data

How can I make a checkbox change to Yes if certain fields in the table contain data, in my case hyperlinks.

For example,the checkbox changes automatically to yes if the field 1 or field 2 or field 3 (or a combination of these) contain hyperlinks to external documents.

The database I am currently working is an Access 2003.

Your help is greatly appreciated.

Thank you

Best,

Sorry, I forgot to mention that I am working on Access 2003 environment.
Aug 17 '11 #1
5 5006
NeoPa
32,556 Expert Mod 16PB
This is exactly what the concept of normalisation (See Database Normalisation and Table structures) warns against doing. I suggest you avoid storing the info and simply query for that whenever required.

Technically, it can be done of course (should you choose to ignore the advice and head down the more troublesome road). A private procedure in your form's module could set the value to match checks for the existence of each, all ORed together :
Expand|Select|Wrap|Line Numbers
  1. Private Sub SetCB()
  2.     With Me
  3.         .CB = (Not IsNull(.[Field 1])) Or _
  4.               (Not IsNull(.[Field 2])) Or _
  5.               (Not IsNull(.[Field 3]))
  6.     End With
  7. End Sub
The AfterUpdate event of the three "Field" controls would each call this procedure.

EG. :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Field_1_AfterUpdate()
  2.     Call SetCB
  3. End Sub
Aug 17 '11 #2
Hi NeoPa,

thank you for the code.

I think the problem with applying this code to my form is that the Field 1, Field 2, and Field 3 reside in a pop-up form and they are used for hyperlinks to extenal documents.

Now, the checkbox that will let me know that there are attachments for a certain record reside on the main form.

However, all the three fields do reside on the main table that the main form is based on.

How can I apply the above code to this scenario.

All the help is very appreciated.

Thank you very much,

Best.
Aug 17 '11 #3
NeoPa
32,556 Expert Mod 16PB
I don't think you can. The suggested code was for the question you posted.

If you want to change the question then I suggest you post the relevant details first. That way I don't waste any more time than absolutely necessary.

By the way, did I mention that proceeding in this non-normalised way is liable to lead you into all sorts of problems? I guess I did - but such an important point bears repetition.
Aug 17 '11 #4
Thank you NeoPa,

I wished I could do something better for this database but it was already so purely set up before I started to implement it.

I decided to leave the check box and if attachments related to a certain record exist, the user will have to click the box manually.

Thank you again for your help and sorry for the inconvenience my first question created.

Best,
Aug 18 '11 #5
NeoPa
32,556 Expert Mod 16PB
NeoPa:
I don't think you can.
This refers specifically to the question you asked.
Ecirtaeb:
How can I apply the above code to this scenario.
That is to say "The above code cannot be applied", but not "No code can be applied".

To help with any code that could work though, we'd need to see some details of your situation. Names of objects, how they all fit together, etc.
Aug 18 '11 #6

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

Similar topics

17
by: Dave Smithz | last post by:
Hi there, A PHP application I built has a section which lists a number of members to a club whose names each appear with a check box beside them that can be ticked. These check boxes are part...
20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
1
by: valexena | last post by:
What is the maximum number of tablespaces that contain data for a table containing two LOB columns? -- Posted via http://dbforums.com
1
by: Chumley the Walrus | last post by:
Is there anyway inside a datagrid's parameter list to disallow certain fields in the dataset to be viewed ?
1
by: Voronkov Konstantin | last post by:
Hello All! I want to ask you whether there is any way to check asynchronously whether stdin contain data to read. I tried all operations to read stdin, but it looks all that operations are...
0
by: Aravind | last post by:
Hi folks. I have the following tables (PK = primary key, FK = foreign key): Member (MemNo , MemName, MemType, Course/Faculty) History (..., MemNo , ...) Member and History are linked in a 1...
2
by: llucas | last post by:
After saving a record using a form, I want certain fields on the data entry form to display the same information from the previous record.
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
24
by: MNNovice | last post by:
tblExpDetails has various fields including two Yes/No fields and one Category field. frmExpDetails is based on this table. I would like to add some restrictions wWhen an end user is using...
1
by: saiabhi | last post by:
I have database called products, i am getting these value in the table and i want to add a chex box in the last row, when i select the check box and click on submit. my output should be in another...
1
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.