SunQuest
 
           Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old September 29th, 2003, 04:16 AM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
checkbox on form

hi,

i have a form with checkboxes.

how can i update the values of both the checkboxes and the textfiled in my tables???

what i need is that if i check on the checkboxes, a text box will appear besides it so that the user can type in the comments based on the checkbox he click.
then how can i update the values of both the checkboxes and the textfiled in my tables???

---------------------------------------------------------------

example

the user check the checkbox sports (checkbox) and write in the comments Swimming (textbox).

in my table it will appear under the | Past-time column |
| Sports - Swimming |

thanks!

Reply With Quote
  #2  
Old September 29th, 2003, 05:22 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
nono270980


In the attached sample open the frmCheckBox, you will see a record with a check box ticked untick it and you will see that the memo ceases to be visible. When you want it visible tick the box.

Look at the on current event and the after update event, and you will see how it works. It is a bit rough but it works and you can take it from there.

The other form is just a sample that i used for someone who wanted the field customername to change colour when data was entered into it.

This is what I think you wanted, let me know.
HTH,

Regards,
__________________
Regards,


John A


Reply With Quote
  #3  
Old September 29th, 2003, 04:19 PM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
oops!!


Forgot the attachment.


Sorry,

Reply With Quote
  #4  
Old September 29th, 2003, 11:35 PM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
check box

hi

thanks that is exactly what i want. but mine involved more than one checkbox.

i have attached an file, i hope u could help me with it.


thanks!
Attached Files
File Type: zip 290265-customer profile.zip (48.5 KB, 429 views)

Reply With Quote
  #5  
Old September 30th, 2003, 05:12 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
nono270980,

Maybe I did not make myself clear, you have to enter the code in BOTH on current event of the form and after update of the control (this one you have done). Put your code in the on current event and you will solve your problem.

If you don't know how to access the On Current event, open you form in design view, point to the little black square in the top left hand corner, right click your mouse and select properties.

Just one thing, the design of you database would allow duplicate "CustomerNames" to be entered. I could enter smith, smith, smith harry, smith mary. How would you find the correct "smith". You should never use "reserved" words when you name fields you have called yours "name" you should use say CusName or CustomerName. Also never use date called it StartDate FinishDate even Mydate but never date.

Good Luck,

Reply With Quote
  #6  
Old September 30th, 2003, 11:15 PM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
check box

hi, with your help, my checkbox are perfectly done. All thanks to u!

but can i ask u another problem??

i would like to capture the values of the textfield that i have entered into another memo field. i know it sound redundant but becoz i need it for my report as i wish to have memofield in my report instead of checkboxes.

I hope u could help me!

for example.

i enter the fields in the forms as what we have discussed earlier where i can click on the checkbox and the textfield will appear.

eg. in a form (only checkbox and textfield)

Past time:
checkbox | textfield
Indoor sports | Squash
Outdoor sports | Swimming

Base on the data i entered into my form i want it to be capture into the memo field in my report as shown below.

eg. in report format (no checkboxes and textfield only memo field (this is in the same table but not shown in the form format) )

Past time :
indoor sports - squash
outdoor sports - swimming

it may seems blur to u. if any queries, feel free to ask me back. i and hope that u can help me with it.

thanks a million

Reply With Quote
  #7  
Old October 1st, 2003, 12:51 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
Have a look at the report named:-

rptMemoYesCheckBoxNo

This shows the memo field and not the check box.

What do you want to do when this happens; user tick a box enters information in the memo field, then unticks the box. The user cannot see the memo field BUT the information is still there.

If you want the report to be show the same as the form then you would have to code the report to show the same as the form.


The counting of the YES in the report, it is just something I did for someone else.

Regards

Reply With Quote
  #8  
Old October 1st, 2003, 12:53 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
oops,


Sorry forgot the attachment.

Reply With Quote
  #9  
Old October 1st, 2003, 04:17 AM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
checkbox

hi,


i have make amendments to your db, i hope u have a backup for yourself.

i have amend the table and add in a new form and a new report named "table 1".

i think this will give a better understanding


thanks
Attached Files
File Type: zip memo & checkboxes.zip (83.3 KB, 415 views)

Reply With Quote
  #10  
Old October 1st, 2003, 05:51 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
Have a look at this, I hope this is what you mean.

If so, then you have to do a little bit of work on the query so that If on of the memo fields is blank it will not leave a space. I would not worry about that at the moment just finish what you started.

Regards,

Reply With Quote
  #11  
Old October 1st, 2003, 08:45 PM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Thumbs up checkbox

hi, u really read my mind! bravo!

can i ask how do u do it? the control source of the past time field is from the table but i cant see any past time field in the table physically. y is this so? and how can i have a next line in the query, becoz u see what i really want is actually something like:

Indoor sports - Squash 'next line for outdoor sports
Outdoor sports - Swimming

in the past time field u have create for me.

and i would like to ask for more...........

if i have 2 items in my outdoor sports , can i have a comma in between, is it possible??

eg.
Indoor sports - Squash 'next line for outdoor sports
Outdoor sports - Swimming, Rock Climbing

and if that is the case i want, how do i check if the data for indoor sports and outdoor sports is empty to display a blank field instead of "Indoor Sports - Outdoor Sports - " in my past time field. i have attach a file, maybe u will get a better understanding out of it.

thanks.
Attached Files
File Type: zip changecolour2.zip (51.0 KB, 301 views)

Reply With Quote
  #12  
Old October 2nd, 2003, 05:18 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
Open the database and look at the query query1 by opening it in the design mode.

You will see what I have done - look for:
PastTime: [indoor sports desc] & " " & [Outdoor sports desc]

This take your 2 fields and combines them into one field. If you want to put in a comma then put it &" , " & here. Say you had the following 3 fields FirstName SecondName Surname and you wanted you show them as one in either a form or report. To do this you would in a query put this in a new column;

Full Name:[FirstName]&" "&[SecondName]&" "&[Surname] this would come out Jack Alan Smith.

As I mentioned in my last post you must learn what to do if one or more of the fields are empty. Not every person has two given names. Look this up in the help section IIF (Examples of returning one of two values on forms and reports)

Regards,


Reply With Quote
  #13  
Old October 2nd, 2003, 09:27 PM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
let say,

i have the query with the past time field :

so i put the IIF( ) in the criteria under the Pasttime field is it?
and in the brackets of the IIf() statement, do i have to include any fieldname??

i have try the following, if the indoor sports desc = blank, then display "".

IIf("indoor sports desc=null","",1) ,then what abt my "outdoor sports desc"


am i correct?

pls advice

Reply With Quote
  #14  
Old October 3rd, 2003, 07:14 AM
ansentry's Avatar
ansentry ansentry is offline
Access amateur
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Melbourne, Australia
Posts: 494 ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level)ansentry User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 5 Days 19 h 49 m 55 sec
Reputation Power: 7
In the attached sample look at query2 (PT) and you will see how the IIF works.

Have a look at report2 and you will see how it appears in a report.


I hope I don offend you if i say that you are trying to put too much into the memo fields.


Regards,

Reply With Quote
  #15  
Old October 5th, 2003, 10:07 PM
nono270980 nono270980 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 69 nono270980 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
checkbox

hi,

it is alright as u do not understand the real situation. i have a db which actually has some confidential stuff which i cannot disclose and i really need to do it this way. that is the reason y i need to put so many things in that particular field.

i hope that u will understand and are to willing to help me, the following attachment is what i have amended and hope that u could help me with it. i actually wish to have the info (retrieve from the two indoor and outdoor field) to be displayed in my another field (pasttime) with a enter key, can i do this???

thanks a million!!!
Attached Files
File Type: zip checkbox.zip (32.9 KB, 285 views)

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > checkbox on form