Populate a field in a record from a command button

Adrian510

Registered User.
Local time
Today, 19:17
Joined
Nov 24, 2005
Messages
38
Hello everyone

I am reasonably inexperianced with Access and VBA development and need some help with something i thought would be realitvly easy .

I have a number of forms that are linked to tables that allows users to select variables which complete the fields in a record. However in a couple of situations i want the users to click a command button and when they do so it will write a text string to a field in the record. I have bound the forms to the correct table and thought all i would need to do is go into the VBE and in the on_click sub ctrl + space select the relevant field and use = "text string" however when i press ctrl + space the field in the table isn't available I have checked everything obvious e.g. that the field is in the table etc etc but have hit a brick wall. Any help would be appreciated.

Regards

Adrian
 
Are you displaying this field on your form in a control?
 
Showing my inexperiance here as i am not sure what you mean. What i have done is added a comand button to a form. It is the only button on it as it effectivly inserts a time value at the start of the day, inserts a text string in another field of the same record and then opens a new form and thats it. Its the writing the text string to the appropriate field in the record that i am having a problem with
 
Just noticed something the only 2 fields from teh record i am trying to populate that i cannot bring up are text fields the rest are all there and they are number or date/time is this why i am encountering a problem? and if so would i be best advised to assign a unique number to each of the possible text string have this recorded in the record on_click and then pull through the text string where it is needed in reports etc?
 
I think you should start by putting a TextBox on your form bound to the field you are trying to update.
 
I will give this a try.

Thanks for the responses

Adrian
 
i have the same problem
I have a a field in one table that requires information to be inserted from another table the field is set to a memo and the table where the information is held is also memo - ( it not just 1 bit of information it could be many )
I have the main record table where I want the infomration stored in called main and the table with the information called wordings

Wording table has unique numbers assigned to each valuie (autonumber and a name for the wording - ie carrot and then the wording that applies to that name - a orange vegable the next one could be apple - a fruit that you make apple pie with blah blah
it's really nothing to do with fruit or veg

I have a memo field in the record source and on the form i had a combo box with the names shown ie Carrot , Apple etc i wanted to select one and then it insert this value into the memo field of the record and then be able to select another one one and it add this to the memo field - any ideas on this would be most help ful

panic
 

Users who are viewing this thread

Back
Top Bottom