Help! forms with dynamic heading or details value

benz_jie

Registered User.
Local time
Tomorrow, 02:06
Joined
Sep 14, 2006
Messages
15
I'm quite don't have enough knowledge on MsAccess, in my previous experienced I've always place a static field label in the forms header and detail values. Can someone advise me on how to design a form to be a dynamic such that there corresponding heading and values will depend on the queries values..like for the example the queries results got 5 heading and its corresponding values,, so will it result on 4 or more heading and values, I want that my forms will also get exactly from queries..

If you have done this in the past, would you be willing to attach or email me a sample Access database or sample code?, my email add is benzjie@gmail.com. Your help are highly appreciated in order for my problem will be solve.
 
in the forms load event or open event you can set the froms caption property

ie me.caption = "whatever you want"

the query driving the form is the property recordsource, so you can find out how many youve got with

dcount("*", me.recordsource) and include this in the caption you are setting.

-----
or when you are navigating the records, in the oncurrent event, you can set the caption to equal a particular field (eg the customername).

hope this does it for you



-------------------
just reread it

this changes the forms caption, not a label

if you have a label in the forms header section, just do the same thing. Its not obvious, but the property you need is the CAPTION of the label, so its

mylabel.caption = "whatever text"
 
Last edited:
ok..thanks Gemma for your reply..I gain idea on what u stated a while ago here....so as of now I hardly imagine on how it appears...if you got some sample program there, can u send me a file?..so that I can see how it really works..


Thanks...
 
So what you're looking for is a generic form based on any query?

e.g.
If query 1 has 3 fields and x number of rows, the form header shows the 3 field names and the form detail has the x number of rows under the headings in a continuous form?

Then if query 2 has 9 fields and x number of rows, the form header shows the 9 field names and the form detail has the x number of rows under the headings in a continuous form?

Is that what you're looking for?
 
yes thats what I would like to know petehill...so that in order for me to display only those fields with values with corresponding headers and details
 
Why do you need to open it up in a form?
Why can't you just view the query instead of a form?

You can create a form dynamically but it would be very very messy.
Perhaps an explanation of why you want to do this would be helpful?
 
I want it that way because based on the data being displayed, and so as one column within that data are all computed for their total values...and another thing is theres a 1 textbox that the user will input numbers for the computation...would it be possible?
 

Users who are viewing this thread

Back
Top Bottom