Forms :: WRITING Records Which Had Been Used By Others

Aug 9, 2015

Firstly, I create a form and sub-form relationship of which the sub-form linked with a combobox on main form. When user wondering in the combobox, the subform could display relavant records related to the invoice number selected in the combobox.

In the subform, records got a YES/NO field (named CHECKAMT) and when I used the following coding to update records in the subform, a message something liked saying the record had been used by another user, you may overwrite those records, copy those records to another place or undo and quit!!

Set TRANS2 = db.OpenRecordset("select * " & " from MSQUARE WHERE INVNO = '" & Me.INVONUM & "'", dbOpenDynaset)
TRANS2.MoveFirst
Do While Not TRANS2.EOF
TRANS2.Edit
TRANS2![AMOUNT] = Null
TRANS2![checkAMT] = -1
TRANS2.UPDATE
TRANS2.MoveFirst
LOOP

View Replies


ADVERTISEMENT

Writing Out All Records From And To Date

Jun 28, 2007

Hi! I have a problem. The code seems ok to me, cant understand it! I cant write out all records between to dates. The dataarea in the table are in the format: General date

Can someone help me?

SELECT * FROM Feil_problem WHERE Feil_problem.dato >= '01.01.2005 00:00:00'
AND Feil_problem.dato <'01.01.2005 00:00:00'

View 6 Replies View Related

Form Data Not Writing To New Records

Nov 30, 2005

Hello All

I am creating a production line database for use on a touch screen (no keyboard or mouse) which has to be really easy to use. At the start of the week i got to the point were i thought i would test what i had done to date and have come across a serious issue.

I thought that the data from the forms i am using to input the data to the main table tblProductionDetails would write into individual records but although new records are created at the appropriate point e.g. when the comand button labelled START on frmDetailsCorrect is clicked the data is not writing to the new record that is created. I thought it would be an easy thing to solve but 20 hours later and much mucking about with DoCmd.Goto's etc i am no further forward. I have attached what i have done in the hope it is something obvious and somebody will be able to point me in the right direction.

The way the db is set up is that frmDayStart needs to be opened the command button clicked and then each form opens once the OK comand button in the top right of each opened form is pressed.

It is still a work in progress so a bit rough and ready but i need to get this fundimental problem sorted before moving on.

Any help appreciated (i am not looking for somebody to do the work on the DB just point me in the right direction or point out what the error might be).

Regards

Adrian

View 14 Replies View Related

Modules & VBA :: Writing Macro To Duplicate Some Records?

Apr 14, 2014

I have a table it contains a list of opening and closing values along with a date and a couple control fields. What I would like to do is duplicate a few fields from records that meet a criteria onto the same table. After that is done there will be a few updates on the new records. Looking at it, it would be: 'duplicate' where field2 <> 0 and field5 = No and field6 = Yes. All other fields on the newly created records would be their default values.

View 7 Replies View Related

Forms :: Writing A Sub To Change Controls

Oct 10, 2014

I have a form with 10 text boxes on it. depending on a Case

I would like to change the special effect and backcolor

select case colour()
case red
Me.Txt1.specialeffect = 1
Me.Txt1.backcolor = RGB(256,256,256,)
case green
etc

I'm trying to write something so that i can apply both these settings to any text box easily.

View 1 Replies View Related

Forms :: Writing To A Textbox - Cannot Assign Vale To This Object

Mar 28, 2013

Having problems writing to this textbox on my form?

Textbox name is: Last_Name
Text Control Source is :Last_Name
Line of code is :

Code:
Me.Last_Name = Me.Combo0.Column(4)

I get the following data in the textbox " #Name?"

And the error:

" You cannot assign a value to this object"

View 7 Replies View Related

Forms :: Binding Results Of Query To Textbox Then Writing Value To Table?

May 19, 2015

Basically, I originally wanted to create a form which I can input data into Access with by using a button (I was unable to get Access to append the information from the forms to the table, so it didn't work out!). I did not want the fields on the form to be linked to a table, as then a record (and most importantly an auto-number) is created as soon as somebody starts typing. Should somebody stop typing halfway through and quit the form an autonumber will have been generated, which makes the number of "users" seem higher than it actually is. I got around this by changing the field from autonumber to number and then creating a query that selects the maximum value of ID in the table, then adds 1 to it (which is essentially the lowest unique number. I tend to call this newID).

The problem I now have is setting this to be written to the table alongside the data from the form (the rest of the fields on the form are now connected to the table, as I am no longer using an autonumber). I have tried the following: Setting the form to run the expression "[ID] = [qryMaximumUserID]![NewID] " on load. This returns the error "The object doesn't contain the Automation object 'qryMaximumUserID.' Setting the control source of the text box to be dLookup. This fills the textbox with the correct value, but then it doesn't write it to the table! Setting the default value of the field to be 0, then running an update query to update any ID of 0 (criteria "0" to the value of newID "update to: [qryMaximumUserID].[NewID]. "). However this doesn't work as whenever the query is run it asks for a parameter to be entered, rather than just taking the value from the other query. Writing a macro that is run on load to SetValue of item:[ID] to expression: [Forms]![qryMaximumUserID]![NewID]. However this returns an error "Microsoft Access cannot find the referenced form 'qryMaximumUserID' you entered in the expression.

View 4 Replies View Related

Forms :: Block User From Writing In Textboxes If They Have Not Selected A Date

Aug 21, 2014

I have a form that has four textboxes, date dropdown box and a date box. I am trying to get the form to do the following: Block user from writing in the textboxes if they have not selected a date in the date box.

Get the datebox to look at the behide screens records to see if there has already been a documented date (duplicate date) and inform the user that this date has already been used. Then auto them to the date dropdown.

View 2 Replies View Related

Forms :: Writing Data Into Text Boxes On A Form Using Variable In Name

Jan 29, 2015

I'm trying to write code which writes text into text boxes on a form depending of certain content of other text boxes. The names of the text boxes are all very similar

F.i. R1, R2, R3 ...... R12 if the content of these boxes are empty then the content of the corresponding text boxes VR1, IR1, VR2, IR2, VR3, IR3.......VR12, IR12 should also be empty.

In fact I am trying to write something like this

DO UNTIL i=12
if me.R(i).value = "" then
me.VR(i).value = ""
me.IR(i).value = ""
endif
LOOP

But this isn't working. The solution below works but isn't a very nice one, writing 12 times the same code

if me.R1.value = "" then
me.VR1.value = ""
me.IR1.value = ""
endif

if me.R2.value = "" then
me.VR2.value = ""
me.IR2.value = ""
endif

View 4 Replies View Related

Writing A Query

May 31, 2006

Hi

I have three fields on the form. First one is Combo box - "Contact person", Second - "Code" is Text field, Third - "Department" is the text field. Corresponding to this I have a table "Department "with fields Contact person, Code, Department.

I want that when I select the Name from the combo box, corresponding records like Code and Department should appear in the respective text box.

Help me in writing this code.

Thanks in Advance Very much
Deepak

View 2 Replies View Related

Help Writing An Expression

Jul 25, 2007

Hi gang, I'm an Access rookie with a problem. I have a table with three columns and I need to create a result field which will "count" the number of occurences of a value in the "CustNum" field. (There are other columns in the table as well so I can't use a "count" function) Please see my simulated results in the "Count" column. I'd like to have a query create this expression. Any help? Thanks! Sorry for the formatting, not sure how to replicate a table in my post.



CustNum FirstLast Count
9891247372KURTFENCHEL 1
9891247372KURTFENCHEL 2
9891247412GRIEGMOORE 1
9891247412GRIEGMOORE 2
9891247412GRIEGMOORE 3
9891247414JohnVerwey 1
161243818DANILOLAMBO 1
9891247198MICHAELSAUNDERS 1
9891247211CATHLEEN DELANOY 1
9891247211CATHLEEN DELANOY 2
9891247211CATHLEEN DELANOY 3
9891247211CATHLEEN DELANOY 4
9891247211CATHLEEN DELANOY 5

View 2 Replies View Related

Syntax For Writing / Can This Be Done

Apr 27, 2006

I'm not sure this can be done,but here goes it, I have 5 [plants] A, B, C, D & E. If one plant recieved [A] plant reject [Reject] then I need a response from plants B, C, D & E. If plant [B] receives a reject then I need a response from plant A, C, D and E. How would I show what other plants havent' responded>

How would I create a query for this? any idea's would be greatly appreciated

View 2 Replies View Related

Macro Writing

May 17, 2005

Hello,

I have a procedure which I undertake and wonder whether it can be automated in any way.

I have a field on a form for Purchases (frmPurchases) for a Purchase Order number. To get the order, I click on a command (cmdpo) which opens another form and clicking a command on this form (cmdgetpono) produces a unique Purchase Order number. I then manually copy the number given and paste it into the field on frmPurchases (PONo).

I have not used Macros before but cannot see that there are the options to achieve this. If someone could suggest the ones I should uses fro the list it would be appreciates.

Alternatively, is there another way of looking at this?

Thank you

Lin

View 2 Replies View Related

Why Is It When You Are Writing Code

Mar 15, 2006

This was to dumb to write in the title. But when I am trying to write a code, the drop down, only stays down for a few seconds. Does that mean I am doing something wrong. I am trying to learn to write, but I am about sharp as marble, when it comes to writing.

Any Ideas

As usual

Many thanks

View 3 Replies View Related

Better Way Of Writing This Code?

Sep 6, 2006

Hello all

Further to an earlier post asking how to check if forms were open ...

I have a form EditCompanyForm which pops up to let people edit the details of a company. The form can be opened from one of three forms.

When the EditCompanyForm is closed I want to update the form that opened it.

So I have this rather ungainly bit of code.
__________________________________________________ ___________
Private Sub Form_Unload(Cancel As Integer)
Dim oAccessObject As AccessObject
Dim FormName As String
FormName = "CompaniesForm"
Set oAccessObject = CurrentProject.AllForms(FormName)
If oAccessObject.IsLoaded Then
Form_CompaniesForm.Requery
End If

Dim oAccessObject1 As AccessObject
Dim FormName1 As String
FormName1 = "CompaniesCallForm"
Set oAccessObject1 = CurrentProject.AllForms(FormName1)
If oAccessObject1.IsLoaded Then
Form_CompaniesCallForm.Requery
End If

Dim oAccessObject2 As AccessObject
Dim FormName2 As String
FormName2 = "CallListForm"
Set oAccessObject2 = CurrentProject.AllForms(FormName2)
If oAccessObject2.IsLoaded Then
Form_CallListForm.Requery
End If
End Sub
__________________________________________________ _

Do I need 3 separate AccessObjects?

Should I be using ... Set oAccessOjbect = nothing ... at the end?

Is there a more elegant way of doing this?

Thanks for any insights.

View 4 Replies View Related

Writing To Another Table

Nov 17, 2006

Hi,

I am fairly new to msaccess programming and am trying to build a stock control system for my business.

I am happy with everything I have done so far but there is one thing I cannot figure out.

I have set up so that the user can click a button and remove the relevant number from the stock level. The buttons are for removing 1, 5, 10 or 20 (there are reasons for these numbers). However I would also like the button to take information from the form (which is referenced to a query) and write that information, along with an autogenerated id number and the current date/time to another table. This is for our record keeping, so that we can record what is selling well etc and when the last one was sold.

How do I do this?

I have gone through the help files and my books, but I think the problem is I don't know where to start looking.

I also want to add a button that will add items to an order table. Again by taking the information from the form and writing it to another table. With this one a message will appear asking for the quantity to be entered. It will also check the order table to see if the item is already there and advise if it is.

Any help gratefully received.

Steve:confused:

View 3 Replies View Related

Writing Error

Feb 11, 2005

Hey guys,

So I'm trying to get the hang of having a Microsoft Access db on an ASP page. I'm just testing the water right now to see how to do simple stuff (selects and updates). Tomorrow I'm going to do loops. Exciting.

Anyways, the tester I have right now is doing a basic update, then select and then print the results. I'm getting the following error:

"Item cannot be found in the collection corresponding to the requested name or ordinal."

It didn't give me this error when the field name was only one word. But because this particular field has spaces in it (and I can't do anything about that sadly), it throws this error. I tried offsetting it with the [ ] but that doesn't do it like it does for the SQL command. I searched the web and didn't really find anything of any help.

The line is:

Response.Write "NAME:" & rs("[Full Name (Name Field)]") & "<BR>"

Without the brackets it gives an exception error message.

Any thoughts?

View 3 Replies View Related

Writing Code For Query

May 31, 2006

Hi

I have three fields on the form. First one is Combo box - "Contact person", Second - "Code" is Text field, Third - "Department" is the text field. Corresponding to this I have a table "Department "with fields Contact person, Code, Department.

I want that when I select the Name from the combo box, corresponding records like Code and Department should appear in the respective text box.

Help me in writing this code.

Thanks in Advance Very much
Deepak

View 1 Replies View Related

Writing A String Into A SQL Query

Mar 5, 2008

i have a string in VB (eg. "test")that will cahnge depending on the input, ihow can i search for the string and display the data into a form?

i currently have this
"SELECT [Tasks].Staff_Name, [Tasks].Project_Title, [Tasks].Percentage_Complete, [Tasks].Tracking_Number FROM [Tasks] WHERE [Tasks].Staff_Name like [forms].[Main].[test] ORDER BY [Tasks].Staff_Name;"



but how can i make it so it spits the data into its corresponding feilds onto a form? (just like it would be if i performed a wizard?)

View 1 Replies View Related

Writing Code For Query

May 31, 2006

Hi

I have three fields on the form. First one is Combo box - "Contact person", Second - "Code" is Text field, Third - "Department" is the text field. Corresponding to this I have a table "Department "with fields Contact person, Code, Department.

I want that when I select the Name from the combo box, corresponding records like Code and Department should appear in the respective text box.

Help me in writing this code.

Thanks in Advance Very much
Deepak

View 1 Replies View Related

Newbie Needs Help Writing Query

May 17, 2006

OK, I have two tables that have pretty much the same data in them, but, the first table has SOME data that the second table doesn't and I need to get that data into the table that does not have it.

Here's a description of what I want to do:

Table #1 has about 10,000 lines of data with the employee SSN as the ID for the records. In this table are two extra columns of data (HRContact)and(HR ContactCode) that are not always populated in Table #2.

Table #2 has about 300,000 lines of data with the SSN as the ID field. Some of the records that match the SSN's from Table #1 have the data HRContact and HRContactCode, but not all of the records have those fields populated.

So, what I need to happen is for the query to go through Table #1, find the SSN of a record. As it finds each SSN, it goes to Table #2, finds that same record with the same SSN, then looks in the HRContact field to see if there is data there, or if it is Null. If there is data in that field, then it goes on to the next SSN in Table #1 and repeats the preceeding process. If the data in HRContact is Null in Table #2, then it goes back to Table #1 and grabs the HRContact and HRContactCode data for that record and writes it into the HRContact and HRContactCode field for the record in Table #2. the query would repeat this process until it reaches the end of file in Table #1.

I hope this is clear and if you have any questions, please ask me...

Thanks for your help,
Dave

View 1 Replies View Related

Writing Code For Query

May 31, 2006

Hi

I have three fields on the form. First one is Combo box - "Contact person", Second - "Code" is Text field, Third - "Department" is the text field. Corresponding to this I have a table "Department "with fields Contact person, Code, Department.

I want that when I select the Name from the combo box, corresponding records like Code and Department should appear in the respective text box.

Help me in writing this code.

Thanks in Advance Very much
Deepak

View 2 Replies View Related

Help With Form Writing To Table

May 17, 2005

I hope this makes sense?
I have a main form with a button that opens a new form. On the new form I have 5 fields. 1 of those fields is the Employee ID which I have the form getting from the main form (IE the Control Source is =Forms!Search_Employee!Employee_ID )and the other fields are bound to my table for the new form. I am unable to get the Employee ID to show in my table, it is not updating or writing the value to that field. Not sure if there is code or how I should or can get this field to write to my table. Any Ideas or be very appreciated. Thanks anyways guys I igured this one out. I was able to set the dafault value to point ot my main form so that my Control Source could point to my table and it worked.

View 1 Replies View Related

Writing Values To A Table

Oct 18, 2005

Hi,

I have a check box that gets ticked when 'work complete', it adds the parts/service totals and fills in the 'parts total', 'vat' and 'total' fields.

This works fine but I need it to write the values to the table as well rather than just displaying the values in the fields so reports can be produced etc.

Anyone know the easiest way to do this?

Thanks

Housey

View 5 Replies View Related

Writing To Two Tables From One Form

Dec 1, 2005

I am building forms from a large questionnaire and I need to write to 2 tables from one field in the form. How can I do this?
The reason I need to do this is because I have over 255 variables so I needed to create 2 tables. I want to write my case number to both files so I will have a link between the 2 files. Thanks.

View 3 Replies View Related

Help Writing An Expression For A Form

May 26, 2006

I am creating a database at my job. The database tracks how many hours a CONSULTANT spent with a CLIENT vs. the number of hours the CLIENT has bought. The hours from the CONSULTANT are entered into three different subforms (because there are a few "types" of hours). I want the total number of hours bought (entered/shown in the parent form) to subtract the hours the consultant worked (hours entered/shown in the sub forms). I half-way got it to work but I am making several entries in each subform and I need to calculate ALL hours. If someone could please help, I would greatly appreciate it. I have attached a copy of the database so to give you a better idea as to what I am talking about.

Thank you.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved