a form and unbound text field problem

webcrab

Registered User.
Local time
Today, 13:14
Joined
Feb 18, 2009
Messages
36
Hi guys!
I am trying to solve this for several days and i realy need your help 'cause i'm kind of lost..
This is the thing:
I have a form with unbound textfields.
I built a query that is the source for the textfiels and the form.
the form is defined as "data entry=no" 'cause ir sepose to show the data but not to update the table.
Anyway, the query is a select kind query that says that the textfields will be field with the specified data that was chosen from the table according to the number i wrote in one of the textfields.

Now, when i write the number in the text field i keep getting this error msg says that It would 'cause duplications in the table.
I know that the number colomn in the table is defind as duplication=no

I don't understand why do i keep getting this messege- the form isn't defined as data entry=yes and the query that is used as source for the controls is a select query .

Is there any way that i can write this:

select name.table, lastname.table, id.table
from table
where id.table= !form[Myform]![idTextBox]
in vb or so 'cause it doesn't work like that ... and i keep getting the duplication messege.

plz help!
thanx:(
 
Sounds to me like your query is trying to save information. But you claim that the form is unbound? I would check that it is infact unbound.

are you basically trying to create a search form?
 
Hi Ray,
well, this is the thing: I'm have 3 textboxes on the form
1. id 2. name 3. last name-

I would like the user to write an id number in the textbox and that the name and last name will apear in the other text boxes as a response to that - they are all basicly coming from the same table .
When I'm writing the id number in the text box it is been explicit as if I would like to add this id number to the table . Again, it isn't a bound field. How can I know if the form is bound?
I don't want it to be a search form ...
 
Well, if you want to type in the ID and have the name come up then technically it is a search form.

You are better off using a combobox for the ID and the others can be filled in using me.comboboxname.column(n) where n is the column name
 
I have a form with unbound textfields. I built a query that is the source for the textfiels and the form.
This makes no sense! If you have a query that is the source for the textfields and the form, then you have a bound form!
the form is defined as "data entry=no" 'cause ir sepose to show the data but not to update the table.

Having Data Entry set to No will not disallow the editing of records; for that you need to set AllowEdits to No.
Now, when i write the number in the text field i keep getting this error msg says that It would 'cause duplications in the table. I know that the number colomn in the table is defind as duplication=no
This supports the fact that the record and field are bound. You're getting the message because you're trying to enter a duplicate value, just as the warning tells you!

You need to either use an unbound form with code as Rainman has suggested, or you need to use a bound form (as you already have) and use a combobox like this:

Add a combo box to your form. The Combobox Wizard will pop up

Select "Find a record based on the value I selected in my combobox."

From the table or query the form is based on, click on the field you're searching by (your ID field) to move it to the right side.

Hit Next.

Size the column appropriately.

Hit Next.

Name the combobox.

Hit Finish.

Now you can drop the combobox down and scroll down to the item to search by, or you can start to enter the item, and the combobox will "autofill" as you type. Hit <Enter> and the record will be retrieved.
 
I guess we need to understand what you want, if you do not want a search form
 
Thanx guys your great- all i needed was the combox solution and i guess the form was bounded..
 

Users who are viewing this thread

Back
Top Bottom