Weird Problem when I save my data on form

Kubalism

Registered User.
Local time
Today, 15:40
Joined
Jul 4, 2012
Messages
36
Hi,

I have 3 tables(Ref_Accident_Status, Ref_Accident_Type, Ref_Seriousness).

On my main form, I created 3 combo box and choosing the above tables as my source. But after I click save and close the form, re open the form it shows numbers on the dropdown list. why is that happening?
 

Attachments

  • First.JPG
    First.JPG
    38.8 KB · Views: 172
  • second.JPG
    second.JPG
    38.2 KB · Views: 163
This would be due to the Bound column of your combo box and the width of that column. I assume your table has a Primary Key autonumber as a unique reference. You just need to 'hide' the column in the combobox by setting the width to 0. EG if you have 3 columns and the bound column is the first then 0;width;width
 
What width would be 0? My dropdown box width? I don't undersrand. Please explain further.
 
It is the column widths property. Open your form in design mode, select the combobox and open the properties window. Then under the Format tab you will find column widths. This tells Access how wide each column of data in your combobox should be.
 
Thanks for the swift reply sir.

0";1" - I have this in the column width. I would change this to what to all combo boxes?
 
the 0";1" indicates that the first column of data in that combobox will not be seen and that the second column is 1 inch wide. Is the first column of data the number you see after reopening the form? can you post the rowsource SQL for your combobox?
 
Thanks for the swift reply sir.

0";1" - I have this in the column width. I would change this to what to all combo boxes?

That is the correct setting, so if it still shows you the number when doing that, odds are pretty good that you have used lookups at TABLE level (see here for more about why those are not so good to use: http://www.mvps.org/access/lookupfields.htm )

so remove them (see here for how: http://www.btabdevelopment.com/ts/removelookups).

You can use lookups at FORM level but they should not be defined in the fields in the tables themselves.


EDIT:
One other possibility is that you have not set the Column Count of the combo to 2 from the default of 1. But that would normally yield a blank once it was selected.
 
Last edited:
@ Isskint

is this what you are asking for ?

SELECT [Ref_Accident_types].[AccidentTypeID], [Ref_Accident_types].[AccidentTypeDescription] FROM Ref_Accident_types ORDER BY [AccidentTypeDescription];

@boblarson

I didn't use a lookup wizard on table form. What I did is I used the Combo Box from the Designs tab. I then set it up to look at the table with the list of accident types.

On the other possibility that you said, it is already set to 2.

Additional Info:

I also set the control source to AccidentTypeDescription

Because if i won't put a field on the control source, my Save and New Macro won't work.
 
Additional Info:

I also set the control source to AccidentTypeDescription

Because if i won't put a field on the control source, my Save and New Macro won't work.
Is the field AccidentTypeDescription a TEXT field? The name makes it sound that way. So, if that field doesn't have a lookup defined at table level, then the only other thing I can think of is that you are trying to save the text (which you shouldn't) and your bound column property is set to 1 but you are wanting it to be 2.
 
First problem solved. But it adding another field on the table which isnt supposed to happen.

Additional question,,

How do I delete data on a table while I am on a form ? :)
 
Command works on deleting entries on the form but not deleting the entries on my table (tblWitness,tblEmployeeInfo)

Thanks

Edit: Problem now it is duplicating the items on my dropdown list.

Ref_Accident_typesAccidentTypeDescriptionViolation Against Proper Conduct and Decorum, Persons and Public MoralsViolation Against Enhancement of Company ProductivityViolation Against Following Customer Service Best PracticeViolation Against Maintenance of Health and Safety and SanitationViolation Against Company Property, Equipment, Facilities and SecurityViolation Against Following Customer Service Best Practice
 
If you want something deleted from multiple tables not just from the table the form is bound to, it will take running one delete query for each.
 
Would anyone know the solution of this problem? Because until I know I can't fix it.

Please anyone,
 
But it adding another field on the table which isnt supposed to happen.
What field is getting added to which table?
How is this happening (eg save button, VBA etc)?
Post any code relevant to this.

Command works on deleting entries on the form but not deleting the entries on my table (tblWitness,tblEmployeeInfo)

Thanks

Edit: Problem now it is duplicating the items on my dropdown list.

Ref_Accident_typesAccidentTypeDescriptionViolation Against Proper Conduct and Decorum, Persons and Public MoralsViolation Against Enhancement of Company ProductivityViolation Against Following Customer Service Best PracticeViolation Against Maintenance of Health and Safety and SanitationViolation Against Company Property, Equipment, Facilities and SecurityViolation Against Following Customer Service Best Practice
Please post the updated version of your combobox rowsource SQL.

The more relevant coding you can post (indeed table structures also) the easier it will be to understand what is happening.
 

Users who are viewing this thread

Back
Top Bottom