sir
I created a multiple choice questions data bank in ms access. some questions have images. in the report blanks gaps are appearing when the question is without image. please help me in this regard. For your kind persual here the database is attached
thank you
mbtilak
I have taken a look at your database, but it keeps getting errors which is probably due to the nature of your table design.
Why do you have 50+ fields in a single table? Your trying to use a database like an excel sheet, instead of a database.
I suggest you read this article on Database Normalization and Table Structures. You will need to get a better understanding of how databases work.
Assuming you always expect 4 possible answers to a question,
I would suggest a structure something along the lines:
tbl_Questions (the table)
with the fields:
KEY_Question, Autonumber, Primary Key
tx_Question, Text Field, with the actual question.
tx_AnswerA, Text Field
tx_AnswerB, Text Field
tx_AnswerC, Text Field
tx_AnswerD, Text Field.
tx_CorrectAnswer, Text Field
Assuming you might have a different amount of possible answers for each question, you need 2 tables, but you can read about that in the article mentioned.
19 6281
Try having the image in a sup-report, and set teh supreport properties
CanGrow=True
CanShrink=True
Then also set the same for the Detail section of the report.
Just subscribing, have downloaded the DB and will look at it later. BTW, there are 7 Reports, which one are you referring to?
Thank you
Report English Paper
Thank you for hint.
I am not successful in getting the result
I have taken a look at your database, but it keeps getting errors which is probably due to the nature of your table design.
Why do you have 50+ fields in a single table? Your trying to use a database like an excel sheet, instead of a database.
I suggest you read this article on Database Normalization and Table Structures. You will need to get a better understanding of how databases work.
Assuming you always expect 4 possible answers to a question,
I would suggest a structure something along the lines:
tbl_Questions (the table)
with the fields:
KEY_Question, Autonumber, Primary Key
tx_Question, Text Field, with the actual question.
tx_AnswerA, Text Field
tx_AnswerB, Text Field
tx_AnswerC, Text Field
tx_AnswerD, Text Field.
tx_CorrectAnswer, Text Field
Assuming you might have a different amount of possible answers for each question, you need 2 tables, but you can read about that in the article mentioned.
thank you sir
I tried the table structure given by you.
Regarding images the same problem is persisting
Even the image is used as subreport the blank spaces are continuing in the report.
Try setting your SQL of the supReport's recordsource to: - SELECT [Question Bank].ID, [Question Bank].Image
-
FROM [Question Bank]
-
WHERE ((([Question Bank].Image) Is Not Null));
The Is Not Null clause will ensure you only get results when there is something in the image field.
If you wish to include ALL Records on your Report whether or not they have an Image assigned, and if you wish to remove the 'Spaces' created by the blank Object Frame containing the Images, this can be done via code in the Format() Event of the Report, but it will be a little tricky. Essentially what you would do is: - For Records that do not have an Image:
- Set the Height of the Image Control to 0.
- Adjust the Top Property of all Controls below the Image Control, basically moving them UP proportionally.
- Resize the Detail Section of the Report, basically shrinking it by the Height of the Image Control.
- For Records that do have an Image:
- Maintain their relative positioning by utilizing the their Tag Property to store their original Top Values.
P.S. - The explanation is simple, the implementation would be much more difficult.
A sup-report has the beauty of only appearing when there is something to show. No need to programmatically change it all.
Sorry TheSmileyOne, I was under the impression that the Sub-Report approach was not working.
The Issue I had forgotton to take into account was that since the image is stored in the same table as the question, there is an ID for each "Image row", whether or not there is an image. Im used to working with subform/subtables, in which case there would only be an entry if you actually added a image. Thats why the "Is not Null" clause should be included.
@mb60
I request you to to make adjustments to meet the requirement in the attachment file. This will help the teaching community in making objective type of questions. Thank you
Try TheSmileyOne's Sub-Form approach first, since creating the code that I previously described would be time consuming to say the least.
@TheSmileyOne
Sorry for disturbing you once again. How to use the code given by you in setting SQL of the sub-report?
You are definately not disturbing me, mb60. The code has absolutely nothing to do with defining the SQL for the Sub-Report. The code will dynamically re-position the Image Control and all Controls below it based on whether or not the Image Control actually contains an Image. The Detail Section of the report will be resized (shrunk) accordingly.
@TheSmileyOne
sir
your technic worked. removed the blank spaces. but images of all records are appearing in the sub report even though they are not selected by using yes/no check box option.
inspite of writing the entire code I used the ' is not value' in the criteria of query.
Well im kinda guessing here, since your post isn't that accurate.
Remember that a subreport must be linked to your main report. Select the subreport from within the main report, and select its properties. You should see "Link Child Fields" and "Link master fields". Clicking the 3 small dots on the right should allow you to set the link criteria. In this case you want to link via ID in main report to ID in child report.
@TheSmileyOne
Sir
As you directed I carried out the changes in my database. It is successful.
my sql is as follows
SELECT Table1.ID, Table1.Q, Table1.[1], Table1.[2], Table1.[3], Table1.[4], Table1.im, Table1.im.FileData, [im].[FileFlags] AS Expr1, Table1.im.FileName, [im].[FileTimeStamp] AS Expr2, Table1.im.FileType, [im].[FileURL] AS Expr3, Table1.sel
FROM Table1
WHERE (((Table1.im.FileName) Is Not Null) AND ((Table1.sel)=-1));
I have a check box named as 'sel' for each record. suppose if a record without image is selected it is not appearing in the report though it has text. I request your help to overcome this problem
Thank you
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ruben |
last post by:
Hello.
I am trying to read a small text file using the readline statement. I
can only read the first 2 records from the file. It stops at the blank
lines or at lines with only spaces. I have a...
|
by: qwweeeit |
last post by:
For a python code I am writing I need to remove all strings
definitions from source and substitute them with a place-holder.
To make clearer:
line 45 sVar="this is the string assigned to sVar"...
|
by: Bob |
last post by:
Hi,
I am using Access 2000 to print out an address book. I have designed
the report based on a database whose first record is not blank. In the
design there is a one line report header, a onle...
|
by: Danny |
last post by:
Given this:
"*"
the pattern to remove the htnl code between brackets, how can I remove a
series of spaces and just make one space.
like here is a series of blank...
|
by: Nhmiller |
last post by:
Access seems to always generate a second page, which is blank, to my one page
report. How do I delete the second page? Thanks.
Neil
Cat Paintings At Carol Wilson Gallery...
|
by: Olveres |
last post by:
Hi,
I have managed to work out how to add new lines into a calculated text
box. However in this text box some of the outcome fields are empty
however when previewing the report it includes the...
|
by: colleen1980 |
last post by:
I try to remove the spaces with that method but it still dont work.
When i run in the debug mode it still shows spaces.
If (bCorpFound) Then
strCorp = LTrim(strCorp)
strCorp = RTrim(strCorp)...
|
by: siomay87 |
last post by:
please help
i have a problem in the ms access reporting,
my report have: page header, detail, page footer and report footer
In listing "detail section", the number of line is depend on the data...
|
by: maryanncanor |
last post by:
Hi everyone,
My problem is whenever I export a report to a textfile. The output textfile have blank spaces.
Here is my query:
SELECT ( & '|' & & '|'...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |