If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Forms newbie question
I have been searching for the answer to this for several hours and it is is
probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#2
|
|||
|
|||
Forms newbie question
instead of putting the equation into the control
1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#3
|
|||
|
|||
Forms newbie question
Hi Crystal,
Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#4
|
|||
|
|||
Forms newbie question
Hello,
Me. refers to the form (or report) that you are behind BeforeInsert runs the moment a character is typed into a field to create a new record BeforeUpdate runs after BeforeInsert on a new record after the fields are filled out AND it runs when you make changes to a record. Once the record is created, I am assuming you do not want to change this field again...but maybe you do... you should always change the names of your controls to something logical. Change the NAME property of Text20 to reflect the contents of what is in there. Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Hi Crystal, Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#5
|
|||
|
|||
Forms newbie question
Crystal,
Thanks again for taking the time to reply. Ok, got the Me. bit. There is no Before Insert option available on the events tab for the text box which is why I used the Before Update option. I don't imagine that I would want the user name to change on a record at this stage. So I now have "frmQuote.UserInfo=fOSUserName()" in the BeforeUpdate field and I am not getting the username appearing in the table behind the form (controlsource is set to the appropriate table field). What am I still doing wrong ? Regards, IK "strive4peace" wrote: Hello, Me. refers to the form (or report) that you are behind BeforeInsert runs the moment a character is typed into a field to create a new record BeforeUpdate runs after BeforeInsert on a new record after the fields are filled out AND it runs when you make changes to a record. Once the record is created, I am assuming you do not want to change this field again...but maybe you do... you should always change the names of your controls to something logical. Change the NAME property of Text20 to reflect the contents of what is in there. Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Hi Crystal, Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#6
|
|||
|
|||
Forms newbie question
use the FORM BeforeInsert... sorry I didn't specify that...
you need to make the ControlSource property of your textbox -- the field you are trying to fill to turn on the property sheet: fro the menu -- View, Properties and then click on the textbox control and choose the Data tab in the property sheet to select the form, click in the upper left where the rulers intersect and choose the Events tab on the property sheet click in BeforeInsert and then on the Builder (...) button, then Code Builder Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Crystal, Thanks again for taking the time to reply. Ok, got the Me. bit. There is no Before Insert option available on the events tab for the text box which is why I used the Before Update option. I don't imagine that I would want the user name to change on a record at this stage. So I now have "frmQuote.UserInfo=fOSUserName()" in the BeforeUpdate field and I am not getting the username appearing in the table behind the form (controlsource is set to the appropriate table field). What am I still doing wrong ? Regards, IK "strive4peace" wrote: Hello, Me. refers to the form (or report) that you are behind BeforeInsert runs the moment a character is typed into a field to create a new record BeforeUpdate runs after BeforeInsert on a new record after the fields are filled out AND it runs when you make changes to a record. Once the record is created, I am assuming you do not want to change this field again...but maybe you do... you should always change the names of your controls to something logical. Change the NAME property of Text20 to reflect the contents of what is in there. Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Hi Crystal, Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#7
|
|||
|
|||
Forms newbie question
inch by inch.....(thanks for your patience) I now have the following in the code builder window - Private Sub Form_BeforeInsert(Cancel As Integer) frmQuote.UserInfo = fOSUserName() End Sub And I now get run-time error "424" - Object Required OK....what have I screwed up now ? IK "strive4peace" wrote: use the FORM BeforeInsert... sorry I didn't specify that... you need to make the ControlSource property of your textbox -- the field you are trying to fill to turn on the property sheet: fro the menu -- View, Properties and then click on the textbox control and choose the Data tab in the property sheet to select the form, click in the upper left where the rulers intersect and choose the Events tab on the property sheet click in BeforeInsert and then on the Builder (...) button, then Code Builder Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Crystal, Thanks again for taking the time to reply. Ok, got the Me. bit. There is no Before Insert option available on the events tab for the text box which is why I used the Before Update option. I don't imagine that I would want the user name to change on a record at this stage. So I now have "frmQuote.UserInfo=fOSUserName()" in the BeforeUpdate field and I am not getting the username appearing in the table behind the form (controlsource is set to the appropriate table field). What am I still doing wrong ? Regards, IK "strive4peace" wrote: Hello, Me. refers to the form (or report) that you are behind BeforeInsert runs the moment a character is typed into a field to create a new record BeforeUpdate runs after BeforeInsert on a new record after the fields are filled out AND it runs when you make changes to a record. Once the record is created, I am assuming you do not want to change this field again...but maybe you do... you should always change the names of your controls to something logical. Change the NAME property of Text20 to reflect the contents of what is in there. Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Hi Crystal, Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#8
|
|||
|
|||
Forms newbie question
since you are in the code behind your form
Private Sub Form_BeforeInsert(Cancel As Integer) Me.UserInfo = fOSUserName() End Sub besides, a valid reference would be forms!frmQuote.UserInfo = fOSUserName() Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: inch by inch.....(thanks for your patience) I now have the following in the code builder window - Private Sub Form_BeforeInsert(Cancel As Integer) frmQuote.UserInfo = fOSUserName() End Sub And I now get run-time error "424" - Object Required OK....what have I screwed up now ? IK "strive4peace" wrote: use the FORM BeforeInsert... sorry I didn't specify that... you need to make the ControlSource property of your textbox -- the field you are trying to fill to turn on the property sheet: fro the menu -- View, Properties and then click on the textbox control and choose the Data tab in the property sheet to select the form, click in the upper left where the rulers intersect and choose the Events tab on the property sheet click in BeforeInsert and then on the Builder (...) button, then Code Builder Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Crystal, Thanks again for taking the time to reply. Ok, got the Me. bit. There is no Before Insert option available on the events tab for the text box which is why I used the Before Update option. I don't imagine that I would want the user name to change on a record at this stage. So I now have "frmQuote.UserInfo=fOSUserName()" in the BeforeUpdate field and I am not getting the username appearing in the table behind the form (controlsource is set to the appropriate table field). What am I still doing wrong ? Regards, IK "strive4peace" wrote: Hello, Me. refers to the form (or report) that you are behind BeforeInsert runs the moment a character is typed into a field to create a new record BeforeUpdate runs after BeforeInsert on a new record after the fields are filled out AND it runs when you make changes to a record. Once the record is created, I am assuming you do not want to change this field again...but maybe you do... you should always change the names of your controls to something logical. Change the NAME property of Text20 to reflect the contents of what is in there. Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Hi Crystal, Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#9
|
|||
|
|||
Forms newbie question
Thanks so much ! We have a winner.
Best Regards, IK "strive4peace" wrote: since you are in the code behind your form Private Sub Form_BeforeInsert(Cancel As Integer) Me.UserInfo = fOSUserName() End Sub besides, a valid reference would be forms!frmQuote.UserInfo = fOSUserName() Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: inch by inch.....(thanks for your patience) I now have the following in the code builder window - Private Sub Form_BeforeInsert(Cancel As Integer) frmQuote.UserInfo = fOSUserName() End Sub And I now get run-time error "424" - Object Required OK....what have I screwed up now ? IK "strive4peace" wrote: use the FORM BeforeInsert... sorry I didn't specify that... you need to make the ControlSource property of your textbox -- the field you are trying to fill to turn on the property sheet: fro the menu -- View, Properties and then click on the textbox control and choose the Data tab in the property sheet to select the form, click in the upper left where the rulers intersect and choose the Events tab on the property sheet click in BeforeInsert and then on the Builder (...) button, then Code Builder Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Crystal, Thanks again for taking the time to reply. Ok, got the Me. bit. There is no Before Insert option available on the events tab for the text box which is why I used the Before Update option. I don't imagine that I would want the user name to change on a record at this stage. So I now have "frmQuote.UserInfo=fOSUserName()" in the BeforeUpdate field and I am not getting the username appearing in the table behind the form (controlsource is set to the appropriate table field). What am I still doing wrong ? Regards, IK "strive4peace" wrote: Hello, Me. refers to the form (or report) that you are behind BeforeInsert runs the moment a character is typed into a field to create a new record BeforeUpdate runs after BeforeInsert on a new record after the fields are filled out AND it runs when you make changes to a record. Once the record is created, I am assuming you do not want to change this field again...but maybe you do... you should always change the names of your controls to something logical. Change the NAME property of Text20 to reflect the contents of what is in there. Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Hi Crystal, Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
#10
|
|||
|
|||
Forms newbie question
you're welcome happy to help
Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Thanks so much ! We have a winner. Best Regards, IK "strive4peace" wrote: since you are in the code behind your form Private Sub Form_BeforeInsert(Cancel As Integer) Me.UserInfo = fOSUserName() End Sub besides, a valid reference would be forms!frmQuote.UserInfo = fOSUserName() Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: inch by inch.....(thanks for your patience) I now have the following in the code builder window - Private Sub Form_BeforeInsert(Cancel As Integer) frmQuote.UserInfo = fOSUserName() End Sub And I now get run-time error "424" - Object Required OK....what have I screwed up now ? IK "strive4peace" wrote: use the FORM BeforeInsert... sorry I didn't specify that... you need to make the ControlSource property of your textbox -- the field you are trying to fill to turn on the property sheet: fro the menu -- View, Properties and then click on the textbox control and choose the Data tab in the property sheet to select the form, click in the upper left where the rulers intersect and choose the Events tab on the property sheet click in BeforeInsert and then on the Builder (...) button, then Code Builder Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Crystal, Thanks again for taking the time to reply. Ok, got the Me. bit. There is no Before Insert option available on the events tab for the text box which is why I used the Before Update option. I don't imagine that I would want the user name to change on a record at this stage. So I now have "frmQuote.UserInfo=fOSUserName()" in the BeforeUpdate field and I am not getting the username appearing in the table behind the form (controlsource is set to the appropriate table field). What am I still doing wrong ? Regards, IK "strive4peace" wrote: Hello, Me. refers to the form (or report) that you are behind BeforeInsert runs the moment a character is typed into a field to create a new record BeforeUpdate runs after BeforeInsert on a new record after the fields are filled out AND it runs when you make changes to a record. Once the record is created, I am assuming you do not want to change this field again...but maybe you do... you should always change the names of your controls to something logical. Change the NAME property of Text20 to reflect the contents of what is in there. Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: Hi Crystal, Thanks for the prompt reply. I'm OK with step 1. It's step 2. that I have seen in my searches but I can't turn into reality. For starters, superdumb question - what's with the "me." ? I ussume this is supposed to be a generic filler and I am supposed to use a reference specific to my database but which one ? I have typed in the Before Update field on the Events tab for the text box - frmQuote.Text20=fOSUserName(). frmQuote is the name of the form, Text20 is the name of the textbox. I'm guessing I'm going wrong at about here. If I can get this fundamental issue sorted, I'll be off and running. TIA IK "strive4peace" wrote: instead of putting the equation into the control 1. make the ControlSource the field you want to populate 2. use the form BeforeInsert event to fill to fill out the control when a new record is being created ------------------- me.controlname = fOSUserName() ------------------- Have an awesome day Warm Regards, Crystal MVP Microsoft Access strive4peace2006 at yahoo.com SthOzNewbie wrote: I have been searching for the answer to this for several hours and it is is probably just a 'forest for the trees' problem. I have a form in which a textbox captures the Windows userID (control source =fOSUserName) which works fine. How do I get this value into the underlying table in a field called User ? Sorry if this has already been addressed (which it no doubt has) but sometimes it's the simple answers that are the hardest to find. Thanks in advance, IK |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Forms Question or Query Question.. | Ed | Using Forms | 0 | October 1st, 2005 11:35 PM |
odd question (abt opening random forms) | _Bigred | Using Forms | 1 | September 11th, 2005 04:11 AM |
petty question - continuos form's "Dividing Lines" property | WebDude | Using Forms | 2 | July 6th, 2005 12:31 PM |
Newbie relationship question (rather long) | Veli Izzet | General Discussion | 6 | June 21st, 2005 04:41 PM |
Newbie document question please | Dudley Henriques | New Users | 4 | January 9th, 2005 08:38 PM |