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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple way to make changes using a form

Status
Not open for further replies.

osp001

Technical User
Nov 19, 2003
79
0
0
US
Go easy on me. I don't know much programming.

I'm trying to change a status within a form in a very straightforward manner. Using a text box, I want to be able to enter a number to change the status of a "yes/no" field.

In other words, when I enter "1234" into the text box (for tbl_containers.container_id, the "yes/no" field (tbl_containers.container_present) is automatically changed to "yes."

After that, the system would be ready for the next entry; this is so I can change the status on a large number of containers quickly, without using a query.

Any help would be appreciated. Thanks!
 
Would it not be easier to have a continous form with checkboxes sorted by container ID? Just click the ones you want. This could be a popupform or a subform.

If you want to do what you said. Put an unbound textbox on the form. Maybe add a command button to commit the change

Code:
Private Sub cmdCheck_Click()
  Dim strSql As String
  Me.Refresh
  If Not Trim(txtBxContNumber & " ") = "" Then
     strSql = "UPDATE tableName SET tblName.fieldName = True "
     strSql = strSql & "WHERE containerID = " & txtBxContNumber
     DoCmd.RunSQL strSql
  End If
 End Sub
 
How about...

In the form's OnCurrent event.
Code:
If IsNull(me.txtContainerID) or me.txtContainerID = "" Then
    me.ckbContainerPresent = "no"
else
    me.ckbContainerPresent = "yes"
End If


Randy
 
Randy,
I do not think that is what he means. Or if it is what he means it would make little sense. I think they all have container IDs (or you would hope), but then finds some present at a location. Maybe in the warehouse, on the dock, at the vendor.
It would not make sense to have a boolean field, representing the fact that their is a value in another field. You would do this in a calculated field of a query, form, or report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top