Macro for creating a new TextBox in a form

H

HELP!!!!!!!!!

Hello to everybody!!

I'm a new member and rather a beginner at using Microsoft Access and quite
ignorant concerning macros!
I would really appreciate your HELP!!!!!!!
I have a form in which I want to be able to add TextBoxes whenever I want
without having to transfer to the design view. I'm not really sure that I'm
supposed to use a macro...What I did was to select the action "Run Command"
and the command "Change to TextBox" and I applicated this macro to a Command
button which I created to the form!Is this procedure right???If yes why when
I tried to proceed with the macro there was an indication saying the follwing:
"You may be in a read only database or an uncovered database from an earlier
version of Microsoft Access/ The type of object the action apllies to
isn'tcuurently selected or isn't in the active view/ Use only the commands
and macro actions that are currently available for this data base"????
 
S

Steve Schapel

The only type of control that you can "Change To Textbox", as far as I
know, is a combobox. In other words, if you already have a combobox,
you can apply a Change To Textbox command to it. This is not really
what you want.

This is an extrememly unusual request. I have never encountered this
before. I cannot imagine any scenario where you would be adding
textboxes to a form at runtime. Maybe you could explain a little about
what your purpose is here, before anyone can advise on how to go about it.
 
H

HELP!!!!!!!!! via AccessMonster.com

Dear Steve,

Thank you so much for your help!!!!I have quite an imagination, don't I?:p :p
:p :p
I thought that what I did was wrong but had a slight hope that it would work..
..What I'm trying to do is this:

I have a form which contains some data. In this form I created a command box
which opens another one which is made for inserting notes to each
registration. This form has only one Text Box. I want to be able to add more
Text Boxes according to the number of notes each regitration has.

Thanks again!!!

Dimitra



Steve said:
The only type of control that you can "Change To Textbox", as far as I
know, is a combobox. In other words, if you already have a combobox,
you can apply a Change To Textbox command to it. This is not really
what you want.

This is an extrememly unusual request. I have never encountered this
before. I cannot imagine any scenario where you would be adding
textboxes to a form at runtime. Maybe you could explain a little about
what your purpose is here, before anyone can advise on how to go about it.
Hello to everybody!!
[quoted text clipped - 11 lines]
isn'tcuurently selected or isn't in the active view/ Use only the commands
and macro actions that are currently available for this data base"????
 
S

Steve Schapel

Dimitra,

Well, adding more textboxes wouldn't really work, without adding new
fields to the table at the same time.

This is maybe pedantic, but it will probably help you to recognise that
"I have a form which contains some data" is not true. Forms do not
contain data. Tables contain data, and forms display it.

The normal way of handling this type of requirement is to make a
separate table for Notes. In fact, there is a one-to-many relationship
between Registrations and Notes, so your table design / data model
should reflect this reality. The Notes table needs a "foreign key"
field to identify the Registration it belongs to... Do you have a
RegistrationID or some such?

Then, basically you would make a form, in continuous view, based on the
Notes table, and place this as a subform onto the Registration form.
Then you can easily add as many Notes as you want for any given
Registration. Make sense?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top