473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Input form data into table

Hi,

By using an add record button, I would like to add the values on a form (tbfullname) to the table (L1 Reviwer), table is called LC1_Tbl

Some fields on the form have expressions within.

Please could you help whether it be by VBA or SQL?

Form name is called Lc1_tbl
Field in table is L1 Reviewer
textbox on form is called tbfullname

Your help is greatly appreciated.
Sep 3 '15 #1
13 1277
Seth Schrock
2,965 Expert 2GB
Is there a reason that you don't want the form bound to the table, which would make it so that no code is necessary to enter the data from the form into the table?
Sep 3 '15 #2
Thanks for the reply..

I have expressions attached to some 2 of the text boxes so it doesn't seem possible to have these bound to the table.

One expression uses the fOSusername() function and the other is the date
Sep 3 '15 #3
Seth Schrock
2,965 Expert 2GB
Put the expressions in the Default value property instead of the control source property.
Sep 3 '15 #4
Just tried to enter this:

="Welcome, " & DLookUp("[Analyst Name]","Userlist","[LAN ID]=userlanid")

as the default value.. When go to to form view. The text box is empty where as it works ok in the control source.

Cheers
Sep 3 '15 #5
Seth Schrock
2,965 Expert 2GB
Are you looking for the analyst's name whose LAN ID is UserLanID or whose LAN ID is in the UserLanID control? If the latter, then you need to remove it from within the double quotes and also need include single quotes around the value if the value is text.
Sep 3 '15 #6
I have a table called userlist which shows LAN ID and Analyst Name

Using the fOSusername()function, this returns the LAN ID. The dlookup then returns the analyst name based on the userlist..

I think it is the first scenario you present

thanks for help with this.
Sep 3 '15 #7
Seth Schrock
2,965 Expert 2GB
It would actually be the second one because no ones LAN ID is "UserLanID". Mine would be "sschrock" for example. Try the following:
Expand|Select|Wrap|Line Numbers
  1. ="Welcome, " & DLookUp("[Analyst Name]","Userlist","[LAN ID]='" & fOSUserName() & "'")
Sep 3 '15 #8
UserLanID is just the name of a the textbox on the form.

Don't think this one is going to be resolved. I've been trying to find a solution for about 2 weeks.

What about an insert into statement
Sep 3 '15 #9
Seth Schrock
2,965 Expert 2GB
You can do it that way, but then you also have to read from it via code to populate your controls.

I just did some testing, and evidently the DLookup() function doesn't work too well in the Default Value property. Try adding your code to the form's On_Load event to assign the value to your textbox.
Expand|Select|Wrap|Line Numbers
  1. Me.Textbox_Name ="Welcome, " & DLookUp("[Analyst Name]","Userlist","[LAN ID]='" & fOSUserName() & "'") 
Sep 3 '15 #10
Great works perfect with my dlookup..userlanid is text that returns returns the fosuername

One very last thing I promise... When I click Add Record the record fires to the tables! I would like this particular textbox to refresh and show the value again ready for the next record.

Within Form properties, in event, I don't know which one to choose.. Any idea?

Many thanks for your help today
Sep 3 '15 #11
Seth Schrock
2,965 Expert 2GB
Switch it to the form's OnCurrent event and it will change for each record.
Sep 3 '15 #12
Appreciate your guidance here. Works great. Thank you!
Sep 4 '15 #13
Seth Schrock
2,965 Expert 2GB
Glad to help. Good luck on your project.
Sep 4 '15 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
0
by: lucas | last post by:
Hi, I have a simple input form that i use to add records to a sql server database. Bellow that is a datagrid that has one template column that I use to dispaly the 3 fields with some html...
2
by: panyb | last post by:
Hi, Can anybody help to look into this: I have an intranet site, everytime when I want to collect data, users go to the page, login, input form data and submit. And now, I have a lot of datas in...
1
by: Lykus | last post by:
My client wants to have a single input form to input data into several different tables. All of this feeds reports that combine the data entered from the single form in different ways. I need...
3
by: andrewtayloruk | last post by:
I'm a newbie when it come to things php and i'm having a bit of trouble. I'm trying to insert data from an html form into a mysql database and can't get it to work. Just a few bits about my...
1
by: Malli mindwave | last post by:
Hi, I want to send form data to given email id, I'm using mailto:ur@mail.com, but it doesn't working it dirsctly goes to localSystem A/C i.e outlook.. <form name="form1" method="post"...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
3
by: jeremy.gehring | last post by:
Hey all, OK I'm not much of a PHP programmer; but needs must as they say. I have written AJAX file upload system that uses a PERL CGI script so that a PHP script can get the progress (nifty...
1
by: elabuwa | last post by:
Hi guys, Been stuck for a few days with this scenario. Any help? The alert box appears on an error. But the submitting won't stop. The details are submitted and the form is processed. Any...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.