Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form is adding unwanted data.

Status
Not open for further replies.

Rubius

Programmer
May 12, 2000
57
CA
A new problem has arised that seems like it should be happening at all! Reference what has already been done to this thread: <A HREF=" TARGET="_new"> when I goto update the data, it always adds the first item in the database to the collection of items at the location I am presently viewing and updating. Every time I change the location and update the counter and date using the method Doug had suggested (which works great)it adds that line to the location and updates it with the new info.<br>Code looks like this (which is doug's code obviously):<br><br>Private Sub clock_Enter()<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim rs As Recordset<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim a As Integer, SomeValue As Variant<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;SomeValue = Me!clock<br>&nbsp;&nbsp;&nbsp;&nbsp;Set rs = Me![JustinQ2subform].Form.RecordsetClone<br>&nbsp;&nbsp;&nbsp;&nbsp;rs.MoveLast<br>&nbsp;&nbsp;&nbsp;&nbsp;rs.MoveFirst<br>&nbsp;&nbsp;&nbsp;&nbsp;For a = 1 To rs.RecordCount<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rs.Edit<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rs!counter1 = SomeValue&nbsp;&nbsp;&nbsp;&nbsp;'Change the value here<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rs.update<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rs.MoveNext<br>&nbsp;&nbsp;&nbsp;&nbsp;Next<br>&nbsp;&nbsp;&nbsp;&nbsp;rs.Close<br>&nbsp;&nbsp;&nbsp;&nbsp;Me.Requery<br>End Sub<br><br>Thanks for all your time!<br>
 
Ok I have some more information for everyone. It doesn't have anything to do with the code, and may have been occuring before without me noticing it. What seems to happen is that when I put in a date or counter and change it to a different field, access thinks that it is on record one and that value is being updated, so for some reason, it updates that field on the table and because I entered a different location, the location is updated as well. Didn't notice it before because I didn't have a Me.Requery before. How can I make it so that I can enter a counter number from a field of numbers without updating it? Just select and then update the displayed fields. Any specific questions please let me know. <br>Thanks again
 
Alright, I'm an idiot...I'll answer the question for everyone out there who is thinking, &quot;what is this guy talking about??&quot;<br>All I had to do is not give each of the combo boxes a control source so they are just like unbound variables. The row option allows me to still have the list from the table displayed and allows me to select it. Solved all my problems..now someone kill me.<br><br>have a good one.<br>Rubius
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top