Ok Nikos thanky you. if your there, I'll need an address to send it to
:
Nikos offered to sort it out if you e-mail the database.
That is a very, very good offer!
Must be a nice guy
If your data is confidential, just make a copy and delete everything but
a couple of records and change the details for those records.
Regards,
Andreas
Bart wrote:
Sorry for the delay. Simply My combobox in my simple gives a result of zero
records on my report. If I change the combobox to a text box and type in the
same text that i looked up on my combobox the result is 10 records on the
report. Thus the report works fine, Seems the queary works fine, and the
form works fine using a text box to type in the criteria. but if i use a
combobox i always get zero records. I must be building my combo box wrong.
I have searched the help, and online and have rebuilt and redone this
combobox and cannot get positive results. And yes Andreas I used the wizard
with and without "hide the id" and I tried to build a combobox without the
wizard. This is maddening... Any more suguestions please.
Thank you both
Bart
:
Bart,
I'm sorry, I don't understand. If you want, compact and zip your
database and mail it to me so I can have a look.
Nikos
Bart wrote:
Nikos, I have good results if i change the combobox on the form to and
unbound text box. I copied one of the block names from the block table
Then I open the [BlockCost] report , wich opens my [Unit Cost of Block] form
where my unbound text box [blockname] is. I past the block name from the
block table [Block] and click on the OK button and I get the correct result
on my report. If I change the text box on the form to a combo box so the
user can look up a block instead of going to the block table and copying a
block name and pasting it the result is a report with no data. the report
opens with a header and a footer and detail header but no block are listed.
in the criteria in the query in the blockname column I put Forms![unit cost
for block]![blockname]
I must have something wrong when i use the combo box .
:
A-ha! That's definitely something to look into, but not certain this is
your case here. A correct reference returning the wrong data (e.g. ID
instead of displayed name) would simply return no records; being
requested for input again suggests a wrong reference (spelling mistake
in the name of the form/control?).
Nikos
Bart wrote:
Sorry, Must be busy on this site.
I tried leaving the form open and am getting the same results
put code in to just hide the form and same results
i think it is getting the wrong info from the combo box. although the combo
box shows the block name correctly. could it be seing the blockID instead.
:
Bart,
OK... so the query works fine when opened independently, looking up its
criterion on the form successfully? If yes, this same query is the
report's record source, right? So, opening the report should work fine,
while the form is open. The answer to the above questions should be yes,
otherwise this is where you start looking.
In theory, once the report is opened you can close the form; sometimes,
though, if the query is returning a large number of records, they are
not all available at once; you can tell this by opening the query and
noticing if the total number of records is available in the record
selector right away, or you have to force it to go to the last record so
that the number will appear. This latter case suggests you should jkeep
your form open even after the report is opened. If this is your case,
one workaround is to have the code behind the command button set the
form's Visible property to False instead of closing it, and then close
it from the rreport's On Close event.
Nikos
Bart wrote:
Sorry I put it in the wrong order use the combo box to pick out a block,
when the ok button is pushed the report opens and the form closes. does the
form have to stay open the whole time while the report is being viewed
:
Bart,
the form has to remain open while you run the query or the report, so
the query can read the value in the combo selection.
HTH,
Nikos
Bart wrote:
Ok, I.m using access 2000
Went through all the steps from the help to set up a form with macros that
will set the criteria for a queary. then it opens a report with the criteria
that the user put in the form.
started simple. created a form called [unit cost for block] with an unbound
combo box called [blockname] that looks up [blockname] from Table![block].
this works fine. created a report from a queary called [block cost] the
queary works fine when run from the queary. The report i kept simple for now
just has 2 fields [blockname] and [blockcost]. When I run the report, the
form window opens I use the combobox to lookup my block name click ok, the
form closes the report opens and has a report header and the detail header
but no data. In the queary for criteria in the blockname column I have
Forms![unit cost for block]![blockname]
I thought maybee it a column problem from the combo box so i tried just a
text box and typed in the name of a block exactly as it is in the table and
had the same results.
Any suguestions?
THanks
Bart