Full Version: Form control quickies
UtterAccess Forums > Microsoft® Access > Access Forms
JujuAccess
Hi,
couple of quick questions
1) I have a form to input data to a table, with an option group (tick boxes). How can i make it instore text values ("Basic" , "Advance") to the table instead of "1" and "2" ?
2) ..and in anoter form I have a number of criteria comboboxes and a button to produce report based on these criterias. How do i make all data on the field shows if the corresponding criteria combobox is left empty?
examples,
when all boxes are filled:
Seminar = "Reading"
Department = "A"
Report shows: "Reading", "A"
when one box isn't filled:
Seminar = Reading
Department = *empty*
Report shows: "Reading", "A", "B", "C", "D", ..etc.
Thank you
jwhite
CODE
1) In the AfterUpdate of your Frame control (the box around the option buttons),
   Something like this:
 
    Dim strtemp As String
     
    Select Case grpProjects
        Case 1: strtemp = "*"
        Case 2: strtemp = "Pending"
        Case 3: strtemp = "Open"
        Case 4: strtemp = "Hold"
    End Select
     
    'Do what ever you want with strtemp.
     
 
2) When you are building the query, If Me.cboDepartments = "" Then
   build the WHERE portion to: LIKE '*'.
If one or neither of these don't help you, then pleaes post the appropriate procedures so we can see what you currently have.
JujuAccess
Sorry, didnt mean to be a pain or anything but i just wanna let you know i have no experience with Access codings whatsoever. :(
1) i didnt get it to work out. I put this in the Frame around my tick box options. (in After Update)
Private Sub Type_AfterUpdate()
Dim strtemp As String

Select Case grpProjects
Case 1: strtemp = "basic"
Case 2: strtemp = "advance"
End Select
End Sub
2) where exactly do i put that in? In my criteria i already have [Forms]![Searchform]![Department]
THanks for help
jwhite
You're not being a pain -- don't worry about that! Everyone started sometime....
annot tell you where to put it as I have no idea how you currently have it coded. Attach your MDB in a new post and I will look at it (Compact/Repair, compress into a WinZIP file, under 500k)
JujuAccess
Hi , I ran into one more minor problem...so altogether i would like:
tick box to register text name to a Table
2 show all data on the Report if combobox is left empty
*3) Combobox to display list of only Unique name ( This is same problem as this thread , but somehow it didnt work for me )
Please have a look ( could u also explain a bit on how u do as well !!) thanks
JujuAccess
Thanks you , sorry to trouble you (i was hoping they required only minor fixes).
Am a complete Access newb and I started to build this database from scratch a week ago, with mostly help from other members and lots of trial and error...so dont be surprised if my designflow is a total mess! (the attachment is just an example of the "workflow" of the real database i got)
JujuAccess
i managed to fix those things, but i still can't get the 'seemingly easy solution' to display Unique value for my combobox(es) in my form. here is my setup:
My form is to Choose a Seminar and Choose department(s) that sent their officers to attend. I allowed up to 5 departments.
so i have 6 boxes based on a query (i changed to english fieldnames just for this). The Box [Seminar] is OK since the records are already unique. The [Department] however is based on a table with repeat records. I searched and found answer (to change properties of query to Yes for Unique record) but still doesnt work.
...could it be that it doesnt work because i have 5 comboboxes pulling records on the same field???
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.