Autofill A Form Window From A Table?
Sep 25, 2006
Hi all,
Sorry if this has been asked before, but I've used the Search function and can't find exactly what I'm trying to achieve.
The Current Setup
I have a database that I'm now trying to expand upon by adding extra features. One of these features I'd like to add is the ability to, firstly, know how many records in the entire datasheet have not been officially closed (i.e. have their 'rmaclosed' column empty), and, secondly, to have a list autogenerated that shows all of these records and allows the user to double click an item from the list and have that record open.
Now, to make life easier, I should point out that I already have a successfully working search function in my database. Clicking a button from the switchboard opens up a form that allows the user to enter full or partial text into a box, then, at the click of another button, the main window of the form will automatically fill out with a list of all those records which match the entered text. The user can then double click anything from this generated list and the appropriate record will be opened.
Working on the assumption that the code for what I want to achieve would be near-identical to this search function code, I have replicated both the form and code, and am now trying to adapt it; it is this adaption I'm having trouble with.
The Current Situation
Take a look at the attached image. That is how my form looks to the user when opened.
Now what I really, really want to achieve is for that central window to be automatically filled out with the listed column headings of any record stored in the table maindata that has a Null value in the column rmaclosed when the form is opened. However, I don't see any option for 'OnLoad', so I'm willing to compromise and just have the user click a button.
You'll see the button there for 'List RMAs'. When clicked, that should populate the main window with the records that have not had their 'rmaclosed' column filled out. The code behind the button - which is where I'm having the problem - is as follows:
Private Sub cmdSearch_Click()
Dim strSQL As String, strOrder As String, strWhere As String
Dim dbNm As Database
Dim qryDef As QueryDef
Set dbNm = CurrentDb()
strSQL = "SELECT maindata.ID, maindata.rmanumber, maindata.company, maindata.rmalogged, maindata.initials " & _
"FROM maindata"
strWhere = "WHERE"
strOrder = "ORDER BY maindata.ID;"
'THIS IS THE BIT I'M HAVING TROUBLE WITH
If IsNull(maindata.rmaclosed) Then
strWhere = strWhere & " (maindata.rmaclosed) Like '*" & maindata.rmaclosed & "*' AND"
End If
strWhere = Mid(strWhere, 1, Len(strWhere) - 5)
Me.lstCustInfo.RowSource = strSQL & " " & strWhere & "" & strOrder
End Sub
This code has been adapted from that which - successfully - runs my filtered search engine. The problem is that my search engine runs a query based on text entered onto the search form by the user, whilst the form I'm trying to write should simply list every record in the main table, filtered according to the state of the 'rmaclosed' column.
As I said in the opening paragraph, although it's not essential it would be really nice to have a counter somewhere on the form that would show the total numebr of records in the filtered list.
View Replies
ADVERTISEMENT
Feb 13, 2007
Help. I know just enough about Access to get myself into trouble.
What I want to do is have a form where I enter a low work order # and a high work order # with a series of yes/no questions and then have that autofill a table with work order #s incrementally from the low value to the high value and attach all of the yes/no answers to each work order #.
How do I get the table to autofill from low to high work order #?
Thanks for any help in advance and type slowly. I'm not very bright.
View 2 Replies
View Related
Mar 19, 2007
First of all apologies for the lack of proper terminology I'm a novice Ms Access user and I like to thank everyone in advance for trying to help.
Ok here is the situation:
I have two tables, NewJobs and Contacts which have the following fields.
Newjobs
--------
JobID (AutoNumber, Primary Key)
JobName
JobDate
JobDescription
JobOwner (Linked to table 'contacts' via LookUp)
Contacts
---------
DisplayName
EmailAddress
Department
Extension
Ok basically what I want is to have a form based on table NewJobs which will allow me to enter new jobs into the database. When I get to JobOwner a drop down list linked to 'Contacts' table will show me all the data from column 'DisplayName' and allow me to select it (saves time on typing). I have already done this and its not a problem.
Now I would also like in the same form to have additional fields from table 'contacts' such as EmailAddress, Department and Extension which will autofill with the right information soon after I select a JobOwner from the drop down list.
So for example if I select 'Joe Bloggs' Access will automatically fill the additional fields in the form with Joe's information (department, extension etc) from the Contacts table.
I hope all this makes sense. Thank you all for your support.
- Mitch
View 3 Replies
View Related
Sep 7, 2004
Hi!
My first post here!
I am quite an amateur at database programming.
I am developing a form to input data about paint samples into a database which represents a sample library.
When the user starts to input data about a new sample into the form, they first have to choose a 'base metal' from a combo box on the form. Based on this 'base metal' selected, after all other fields have been filled in, i want to generate a 'catalogue code' for that record (The 'catalogue code' is an alpha-numeric code). Both 'base metal' and 'catalogue code' values are entered in two fields in the table.
for this i want to have a command button 'Get Catalogue Code' which runs a code to compile the 'alpha-numeric' text using two different tables. I want this text to be inserted into the 'catalogue code' field in that particular record and a message box informing the user what that text is.
I can figure out the code to compile the text and the message box. What i dont know is how to insert the text into that field in the table.
I am willing to provide any more information, including my database to anybody who can help! Thanks in advance!
View 5 Replies
View Related
Jul 10, 2006
Hello
I have two tables tblCList and tblCode. The primary key of tblClist is an autogenerated number which is the foreign key to the tblCode.
The tblCList has another column names sClist.
whenever I import values from Excel into the tblCode, I need Access to look up the text values from the sClist in the tblClist and insert the appropriate number corresponding to the entry in tblCode.
Please Help
Thanks
View 2 Replies
View Related
Jan 28, 2005
I'm hoping someone here can help me out with existing code or at least point me in the right direction... In one of the databases I am developing, I need to set up the ability for one field in NEW records to be autofilled with the next value from a table or query.
Details
My database includes the following objects:
tblSupervisors - supervisor information (including an indicator if they are 'active')
tblCases - case information including name of supervisor assigned to review this case
frmNewCases - allows data entry of new information to tblCases
If someone enters a new case, the Supervisor field would (in an ideal world) automatically fill in with the name of the next active supervisor from tblSupervisors.
Example
The active supervisors in tblSupervisors are Joan, Mark, Lisa, and Gary.
Case #1 is entered and the Supervisor field is automatically pre-filled as Joan.
When Case #2 is entered later, the Supervisor field shows Mark.
When Case #3 is entered later, the Supervisor field shows Lisa. However, because the person entering the case knows Lisa is on vacation, s/he can click a button and Lisa's name is replaced with Gary.
Finally (for this example), Case #4 is entered and Joan is assigned as Supervisor again.
Whew!
Okay. That's it. (I hope.) Any and all help would be GREATLY appreciated!
View 2 Replies
View Related
Dec 5, 2005
I have a Form with a combo box that takes in formation from a table and auto fills it. But i cant get that autofilled info to enter into the main table.the one that the form is based off of. I tried to use an append query to move the info from one table to the other. It didnt work. does anyone know why this error pops up i cant see anything wrong...
Concrete Pumper Database Set 0 fieldsto Nulldue to a type conversionfailure, andit didnt add 3 records due to key violations, 0 records due to lock violations and 0 due to validation rule violations...
in detail what im trying to do is this. database is for remote control concrete pumpers.
I have a form based on a table. In this table i have fields such as model #, button 1 configuration-button 12 configuration date entered, date shipped etc.I created a form from the table and Instead of entering each of the 12 button configurations I would like to have that entered automatically when a model # is selected from a combo box. So i made a table with just model # and button configurations and set up a combo box on the form to match. now i need to get the button config from the button config table to be entered into the MAIN TABLE when entered into the form by combo box. oh man...i dont know if im too far gone or what...this may not make sence so please give it your best...I appreciate any input at all. I thought i could do it with an append query and a macro but now i dont think so.
thank you
View 1 Replies
View Related
Mar 17, 2014
I have 2 tables: A and B with field names:
ID, Title, Link
and one table C with:
ID, Title
The Link in each table "points" on another table.A points on B that points on C.(When you fill in column Link in table A or B, a Lookup table is used so that I can select one of the titles in the linked table).I want to add a new field name called Position in table A and B. The Position is supposed to describe the cells place in the tree.
Example: if A with ID 1 points on B with ID 2, and B with ID 2 points on C with ID 3 then in A Position data field it would say: "3.2.1".I would like it to autofill Position when I add a new title.
View 1 Replies
View Related
Oct 13, 2014
I'm creating a table with times of the day from 08:00 to 17:00 in 15 minute increments.
I'm going to use the table as a lookup to make it easier to enter an appointment time.
I don't really want to type them all by hand - does access have an equivalent to excel's drag and autofill a sequence? is it just as easy todo it in excel then cut and paste it?
View 6 Replies
View Related
Jun 10, 2013
I created a table to allow me to enter automobile information.. year, make model, etc.
Now how can i make certain "drop downs" dependent on next to autofill info?
Such as
make= ford
model= crown victoria
make= chevy
model=impala
such that they could not choose a
make=ford
model=impala
because "impala" would not be on that dropdown selection/choice?
View 3 Replies
View Related
Feb 11, 2015
I essentially created an account since I can't seem to find a straightforward answer much anywhere else (plenty of hints on auto-filling forms- but that isn't particularly conducive to my specific need on this).
I've attached a blank copy of my database.
The immediate concern I'm having is that I want to be able to autofill data in the invoice table based on the customer table and the products/service table.
*I want to be able to select a first name [or other primary key if necessary] to fill in the last name, company, address, city/state/zip, phone, fax, cell/alt phone, and email automatically... that is without multiple dropdown selections or input to those sections at all.
*I want prices to fill in to the 'cost of product/service X' so that I may use it for other calculations in the invoice table- as well as to make forms from it directly.
View 7 Replies
View Related
May 24, 2006
Hello
I'm new to Access Programming and the whole Visual Basic bit and I have a project I need to finish.
Well I created a Form and what I want to do is this:
If I enter an ID number, I want the Form to populate the rest of the fields automatically (eg. phone number, address etc.).
Can you please give me ideas on how to do this? Thanks a lot. :)
View 1 Replies
View Related
May 24, 2006
Hello
I'm new to Access Programming and the whole Visual Basic bit and I have a project I need to finish.
Well I created a Form and what I want to do is this:
If I enter an ID number, I want the Form to populate the rest of the fields automatically (eg. phone number, address etc.).
Can you please give me ideas on how to do this? Thanks a lot. :)
View 1 Replies
View Related
Apr 18, 2007
I have an Access database with several tables and a multitude of subforms which are displayed on a single master form. The subforms are used to facilitate data entry. In several of the tables there are fields which are related and I would like to have some of these fields updated based on the results entered in the related field (i.e. the answer for one field depends on the other).
Field 1Field 2
[facing][DISC_CODE]
un3
up1
dn2
Field 1 is a simply a description of the basic dataset. This field is already set-up on form as a combo box that allows the user to choose one of three options. Field 2 is a code number used by another piece of software to identify a particular symbol. It is a new field being added to the database. There are 200 codes that identify a wide range of symbols for different types of data and I don’t want to have to look them up when I, or my assistants, are doing data entry.
My question is this; is there anyway to have the DISC_CODE value, Field 2, automatically entered in the table when the value for Field 1 is selected in the combo box on the form?
View 1 Replies
View Related
Jan 8, 2013
I am new to Access (using Access 2012) and All I am trying to achieve is to autofill the field [Frequency] from Table FullList based on the value of [Frequency] from Table Courses using a DLookup code used to update the FullList form. The code is not updating anything! It is frustrating! Frequency is a number (integer) and while Course is a text. The figures of my Access database are below.
View 2 Replies
View Related
Feb 15, 2005
Hi,
I have a parent window which upon clicking on a button will pop-up a child window containing a listbox. The listbox recordsource is a subset of the parent window. I want the user to select a record from the listbox which will load the selected record onto the parent window.
How does one pass argument back from child window to parent window?
From parent window to child window, I used
docmd.openform ,,,,,,[argument] and me.openargs in the child window
thanks in advance.
View 4 Replies
View Related
Feb 18, 2007
Hi,
I have a form that has a field called scope of work which is a combo box that you have 3 options to select from.
I have set up a table called scope of work which has other fields
ie: Scope of work, Est Man Hours, Normal Rate, Overtime Rate and Est Due Date.
The combo box works fine selecting the scope of work but I want the fields on the form to automatically fill in the other information. Say they select option 1 in the scope of work based on this option it will fill in 40hrs at $150 per hour normal rate and $180 per hour overtime rate and this will take 4 weeks to complete. Based on the start date field it will also calculate 4 weeks from now for the completion date.
I have tried everything from queries using SQL statements, joining tables one to many etc.. and for some reason I cannot seem to get it to work for me and I've spent hours searching around for a solution..
If anyone has any ideas it would be greatly greatly greatly appreciated!!
Thanks a Bunch
View 1 Replies
View Related
May 9, 2005
I have a table with customers details(Address Etc) but there is too many for me to use a combo or list box so i would like to use a text box.
Here lies my problem.
What i need is to be able to enter into a text box on form1 the first few letters of the customer ID no and this will open a hidden subform that will list the customers with those first few letters.
I then want to be able to select one from the list using the number keys and once i press enter it opens another form(form2) with all the customer information already inserted into the text boxes on form2.
View 6 Replies
View Related
Jul 22, 2005
I am creating an ostensibly simple database, but I need help trying to get it to work. There are three tables.
1.Users – UserID, Dept Code, LName, FName
2.Boxes – BoxNumber, Description, Contents, and many other fields
3.CheckOut (junction table) – UserID, BoxNumber, Description, DateIn, DateOut
I want to create a form that would have the User fields at the top and a subform with the checkout fields.
I need the user fields to autopopulate after filling in the UserID (primary key).
I need the box Description to autopopulate after filling in the BoxNumber (primary key). At the moment, the form thinks that I am trying to ADD new records. There are no new records (boxes) being added. I simply want to use the form to check out and check out boxes.
Any help is appreciated. Thank you in advance.
View 5 Replies
View Related
Apr 12, 2005
I have a table that containes: Member#, FirstName, LastName, CompanyName, etc. Multiple entries can be in the table for each Member#. On my form when a Member# is entered, if that # is already in the table, I would like for the form to autofill the FirstName, LastName, and CompanyName fields from the table. This is added protection to be sure the Member# typed is correct. If the # is not already in the table, then nothing will autofill. I am not new to Access...but my knowledge is not above "3rd grade". Can someone help with this problem, or can it even be done on the form?
Thanks, Linda
View 3 Replies
View Related
Sep 14, 2006
Hi all! :D
I'm trying to make a form to autofill with customer data (from a database), with 4 columns (= 4 customers). Each column contains on top a combo box and below 5 text boxes with address, phone etc.
So i created a form and placed a combo-box (from wizard) with the option "Find a record on my form based on the value i selected in my combo box".
The problem is that this one combo box controls all the text boxes. Even if i create an other one, it still controls all of them.
So i'd like to ask: How can i link a combo box, to autofill specific textboxes?:confused:
Thanks... :)
View 9 Replies
View Related
Nov 9, 2013
I have 2 tables StudySchedule and ExamSchedule.StudySchedule contains the detail information of opening classes of many different periods. I need to create a form that can:
1. let the user choose a period
2. form will generates automatically exam schedules of the opening classes of the chosen using the relevant information in StudySchedule. Those entries will be saved in ExamSchedule.
3. Note that there are 8 fields of the exam schedules generated/counted from some fields of StudySchedule. The 3 other fields of the exam schedules need to be entered by the users. User must also have the ability to edit the generated fields.
View 4 Replies
View Related
Jan 14, 2014
I want to Autofill one of the field in my form, by checking specific conditions in my database. Example of which is as below:
1. Date of Maintenance :
2. Loom No. :
3. Component Replaced :
4. Component Type :
5. Latest date for same component replacement :
I want to autofill the Sr. No. 5 in the form itself by checking database, and if Sr. No.2=Sr No.3=Sr. 4, then latest date should be autofill in Sr. No. 5
Say, A component was replaced in a Loom on 01/01/2013 & again after six month same component is replaced on 01/06/2013 so while filling up the form, In sr. no. 5 latest date 01/01/2013 of replacement of same component in same loom should be pulled from data base.
View 1 Replies
View Related
Sep 13, 2012
I have a review pop up form (frmReview) where a user selects their Name (StaffID), the type of check they are doing (QuailtyType), and the client they want to do it on (clientID). When they press on the 'do review' command button from this form another form opens (frmReviewDetails) which shows the client they selected from the frmReview form as well as a its subform which shows all the sessions that have been entered for this client along with some fields that have not been complted yet regarding review data. I am trying to have it so when they check the 'review check box' in this subform that today date auto populates in the Review date field (this is currently working). I also want it to auto enter the staffID that they selected on the the initial frmReview form.
This is my currunt code:
Private Sub Rev_AfterUpdate()
If Me.Rev = -1 Then
Me.[RevDate] = Now
Else: Me.RevDate = Null
End If
End Sub
I really don't want a staff to have to enter their name each and every time they check the review box. Not all box's are going to be checked, so it needs to be on a record to record basis.
View 2 Replies
View Related
Oct 17, 2013
What I'm trying to do is create a database system for my company, it's not overally complex in the sense it's just managing the estimates and invoices we do.
[Tables]
SalesPersonID
Clients
AccountTerms
Estimate
Invoice
WorkSheet
Now I've tried to break the data down as sensibly as possible.
What i'm having trouble with is I have created a autofill combo box to fill out text boxes with information from the Clients table, the idea is that the client can be added via the Estimate form or pulled up from the record depending on the situation. Now the problem I have is one;
I cannot enter data via the form
and two
When you flick through the forms only the combobox information is staying put, either the text field is empty or incorrect.
I'm pretty it's to do with [Data Source] but I can't seem to get it to work. How to make it possible to pull up clients when typing an estimate OR be able to add a new client via the same fields. Secondly, when the Form is review the autofill text field display the clients details.
The link : [URL] ....
View 3 Replies
View Related
Aug 15, 2015
I want to be able to pre-fill records with information based on a form every day for each client. This needs to display in a datasheet view showing all clients for each location.
Each day the subform needs to show the expected results of that day's activity with clients if all default conditions are met. (i.e. client receives a call that day based on expected conditions calculated in a form for that day).
View 3 Replies
View Related