473,396 Members | 1,834 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.

Autofill form from text box

53
I have a multiple item form that displays fields from an Orders table based on a date range. I want to be able to fill the Received field for the displayed records from a text box on the form all in one shot. Is that possible

I am new at access so please keep that in mind when answering


Thanks,
Lance
Jan 8 '08 #1
8 3359
Minion
108 Expert 100+
If I am understanding your correctly you need to basically move the value of one text box to several other text boxes on your form am I right? If this is the case there is a couple ways you can do this and each is built on basically the same model.

You could:
  • Use a button that would copy the value on command.
    Have the value copy to the boxes once the orginal box is done being edited.
    Or in the case the basis for the Received time is calculated by the form it can be added to the other boxes when the form loads or changes.

As I'm not sure exactly what method will work best for you I will add a basic example of the code. If you are not familar with VBA let us know and we should be able to help.

Expand|Select|Wrap|Line Numbers
  1. Private Event()
  2.    With Me
  3.       .TextBox1 = .ReceivedDate
  4.       .TextBox2 = .ReceivedDate
  5.       .TextBox3 = .ReceivedDate
  6.       .TextBox4 = .ReceivedDate
  7.    End with
  8. End Sub
  9.  
Hope this helps or at least gets you moving in the right direction.

- Minion -
Jan 8 '08 #2
araman
53
Thanks for the reply. I am not familiar with coding.

I have one text box that i want to fill one datasheet subform field which is "Received" from the orders table which is based on a query by date

Thanks,
Jan 8 '08 #3
jaxjagfan
254 Expert 100+
Are these 2 different tables you are updating? Do you have an Orders table and an OrderItems table and trying to flag all items as being "Received" for a particular order?

Without knowing your table/application structure, this is a way to update multiple records.
Attach this to a command button.

Docmd.RunSQL "Update OrderItems Set Received ='" & Me.txtReceived & "' Where OrderID=" & Me.txtOrderID & ";"

Once the correct order is selected in the main form (OrderID) then you have to update the "Received" field in the OrderItems table.

You will need to be more specific with tables, forms and database structure to get a more precise answer.

Hope this helps!
Jan 8 '08 #4
araman
53
I am sure I'm not explaining myself correctly so I'll try by describing what I want to do instead.

i have a table called Orders. In that table resides a field called Received. What I would like to be able to do is populate the Received field to a date of my choosing based on a start date-end date (order date is also a field) criteria and Received is null on a simple click of a command button. Then I could manually delete any Item manually that was backordered.

Thanks,

Lance
Jan 8 '08 #5
jaxjagfan
254 Expert 100+
I am sure I'm not explaining myself correctly so I'll try by describing what I want to do instead.

i have a table called Orders. In that table resides a field called Received. What I would like to be able to do is populate the Received field to a date of my choosing based on a start date-end date (order date is also a field) criteria and Received is null on a simple click of a command button. Then I could manually delete any Item manually that was backordered.

Thanks,

Lance
Do you want to update all orders between a chosen start date and end date? Or just a particular order? It makes a difference whether you will be updating all orders within a date range or just one particular order.

In your data structure can an order have more than one item type type per order?

FYI - If you have an ItemStatus field (Ordered, Rcvd, BackOrdered, etc) then you could add the deletion of the backordered items to the same command button.
Jan 8 '08 #6
araman
53
Thanks for helping.

update by date range and if received (which is a date) value is null

Right now I have an access 2007 Multiple Item form which is wizarded off a query with only the Orders table with the criteria- Between [Start Date] and [End Date] , Received is null.
The Form shows all items matching this. I would like to attach a command button and a text box on this form in which i enter the date i would like to date these records to be received to a date i put in the text box, updating the Orders table only for those records that were returned by the query.
Jan 8 '08 #7
PianoMan64
374 Expert 256MB

update by date range and if received (which is a date) value is null

Right now I have an access 2007 Multiple Item form which is wizarded off a query with only the Orders table with the criteria- Between [Start Date] and [End Date] , Received is null.
The Form shows all items matching this. I would like to attach a command button and a text box on this form in which i enter the date i would like to date these records to be received to a date i put in the text box, updating the Orders table only for those records that were returned by the query.
I think I know what you want to do. You want to be able to put a Start and End Date into two different fields and then click Update Orders and the date that you want to put into that is the current date that you pushed the button?

If so here is what you're going to need to do:

First create the two Text Control boxes (Those are the ones that allow you to put something into a field. Please make sure that the wizard function on the form is turned off, otherwise it's going to be asking you questions about what you want to do with each field and the button on the form.

Please name the first TextControl txtStartDate.
Please name the Second TextControl txtEndDate
Please name the Button Control btnUpdateOrders

www.joepottschmidt.com/example1.htm

Then copy and paste this code into your Subroutine that is for the Button Click event.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub btnUpdateOrders_Click()
  3.  
  4. '-----------------------------------------------------------------------------------------------------------------
  5. 'Copy from the top of this line down to just before the End Sub
  6. '-----------------------------------------------------------------------------------------------------------------
  7.           Dim MyDB as DAO.Database
  8.           Dim MyRS as DAO.Recordset
  9.  
  10.           Set MyDB = CurrentDB()
  11.           Set MyRS = MyDB.OpenRecordset("SELECT * FROM [Table Name] " & _
  12.                 "WHERE OrderDate = #" & me.txtStartDate & "# AND #" & me.txtEndDate & "#", dbOpenDynaset)
  13.  
  14.           With MyRS
  15.                   Do While Not .EOF
  16.                        .Edit
  17.                        !TheNameOfTheDateFieldThatYouWantToChange = me.TxtTheDate 
  18.                        'This is the field that you want to update as well as the 
  19. '                       field on the form that you want to enter the date of these orders.
  20.                        .Update
  21.                        .MoveNext
  22.                   Loop
  23.           End With
  24.  
  25. MyRS.Close
  26. MyDB.Close
  27.  
  28. Set MyRS = nothing
  29. Set MyDB = Nothing
  30. '-------------------------------------------------------------------------------------------------------------------
  31. 'Stop Copying Here
  32. --------------------------------------------------------------------------------------------------------------------
  33.  
  34. End Sub
  35.  
  36.  
Hope that helps,

Joe P.
Jan 10 '08 #8
araman
53
thanks for the reply

this is what i got that works, it look much like yours

Private Sub Command22_Click()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
Do Until rs.EOF
rs.Edit
rs!Received = Me.Text20
rs.Update
rs.MoveNext
Loop


End Sub


Thanks,

Lance
Jan 10 '08 #9

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

Similar topics

0
by: Chris Sharman | last post by:
I'd like to design my pages to work cooperatively with browser autofill features. I've loked around, but can't find any good documentation on supported/unsupported field names...
1
by: shortbackandsides.no | last post by:
I'm having a lot of difficulty trying to persuade the Google toolbar autofill to act consistently, for example ======================= <html><head> <title>autofill test</title> </head><body>...
0
by: David Portabella | last post by:
Hello, I am a doing a survey about Autofill Web Forms softwares. Usually, they all collect information of the user once during the set-up phase (user knowledge base). Then, when the user...
1
by: Nick J | last post by:
Hi, I remember at one point access would autofill a text box when filtering by form, Like for example as I would type it would come up with matching records, similar to AutoComplete in Internet...
4
by: HTS | last post by:
I have written a membership database application (PHP + mySQL) and need to prevent autofill from filling in fields in a member record edit form. I know I can turn off autoFill in my browsers, I...
6
by: bloukopkoggelmander | last post by:
All I am new to this site and hopefully would have a good time here. I am new to Microsoft Access and VBA and am currently involved in a project to create a new database for one of our company...
1
by: Rissoman | last post by:
Hello, I have an issue were I have a zipcode textbox in an atlas ajax updatepanel. When you tab out of the zip textbox and the shipping is calculated. I know this works perfect! Then a user...
0
by: Randy | last post by:
Hi, I have some comboboxes that are created dynamically at run time based on user actions. I found a procedure on a message board to autofill the combobox text from the dataview that the...
1
by: berlich | last post by:
Can I use visual basic.net to access the DOM in a web page so that I can autofill the text boxes? If so, can you point me in the right direction as to where to begin? I need to fill in a lengthy...
1
by: Nik Coughlin | last post by:
I'm doing some ajax validation on form fields, using the form change event. If I click Autofill in the Google Toolbar, fields are filled out but the change event is never fired, so the validation...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.