If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Data Entry after Select Query
Is there a way to tell a Form to go to Data Entry = Yes, after you have
populated two fields on a form? I am running.. Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant varUnique = DMax("Key", "qryB_Update") End Sub But, after it populates the form with the data from the query, I would like to lock the form down to a Data Entry form. Keeping the data the I filled with the above code. Thanks. |
#2
|
|||
|
|||
Data Entry after Select Query
I'm assuming you are assigning the varUnique value to a certain field.
If that's the case then add the following to your code Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant me.DataEntry=true '- add this line varUnique = DMax("Key", "qryB_Update") me.textbox=varunique '- if you want to assign it to a field... End Sub Remember this only works once because you've placed the code in the on open of the form.. hth -- Maurice Ausum "Tim" wrote: Is there a way to tell a Form to go to Data Entry = Yes, after you have populated two fields on a form? I am running.. Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant varUnique = DMax("Key", "qryB_Update") End Sub But, after it populates the form with the data from the query, I would like to lock the form down to a Data Entry form. Keeping the data the I filled with the above code. Thanks. |
#3
|
|||
|
|||
Data Entry after Select Query
Maurice,
Thanks for the response, but, I can't seems to get the code to work. Adding the me.DataEntry = True still locks the form down to a data entry only and doesn't show the fields populated by the query. There for it adds a new record in the table under the record with the record the data populated by the query. "Maurice" wrote: I'm assuming you are assigning the varUnique value to a certain field. If that's the case then add the following to your code Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant me.DataEntry=true '- add this line varUnique = DMax("Key", "qryB_Update") me.textbox=varunique '- if you want to assign it to a field... End Sub Remember this only works once because you've placed the code in the on open of the form.. hth -- Maurice Ausum "Tim" wrote: Is there a way to tell a Form to go to Data Entry = Yes, after you have populated two fields on a form? I am running.. Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant varUnique = DMax("Key", "qryB_Update") End Sub But, after it populates the form with the data from the query, I would like to lock the form down to a Data Entry form. Keeping the data the I filled with the above code. Thanks. |
#4
|
|||
|
|||
Data Entry after Select Query
Yes, the dataentry options sets a new record. So best option is to lock the
controls individually when you have opened the form. Remains the question why you want to set the form to data entry. Why not set the controls to locked once they are populated with the values. You could set them to me.textbox.locked=true. If you want to use some kind of loop for this you could use something like Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant Dim ctl As control varUnique = DMax("Key", "qryB_Update") for each ctl in me if ctl.tag = "some text" then ctl.locked=true end if next End Sub In this case you could place a text in the tag of the control. for instance "lock". replace the "some text" for the text you place in the tag of the control. hth -- Maurice Ausum "Tim" wrote: Maurice, Thanks for the response, but, I can't seems to get the code to work. Adding the me.DataEntry = True still locks the form down to a data entry only and doesn't show the fields populated by the query. There for it adds a new record in the table under the record with the record the data populated by the query. "Maurice" wrote: I'm assuming you are assigning the varUnique value to a certain field. If that's the case then add the following to your code Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant me.DataEntry=true '- add this line varUnique = DMax("Key", "qryB_Update") me.textbox=varunique '- if you want to assign it to a field... End Sub Remember this only works once because you've placed the code in the on open of the form.. hth -- Maurice Ausum "Tim" wrote: Is there a way to tell a Form to go to Data Entry = Yes, after you have populated two fields on a form? I am running.. Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant varUnique = DMax("Key", "qryB_Update") End Sub But, after it populates the form with the data from the query, I would like to lock the form down to a Data Entry form. Keeping the data the I filled with the above code. Thanks. |
#5
|
|||
|
|||
Data Entry after Select Query
Maurice, Thanks again for the quick response.
I am going after the Data Entry Form because of the users entering the data! I need to make the DB as bullet proof, easy and simple as possible. The less screens they can jump around too, the less they will be confused and call me. I think one of the best fixes is the DLL that lets you kill the mouse wheel, but I am having a hard time getting my IT people to let me install it for some reason. Thanks for the code on the field locks. I may be able to work with that. Thanks again. "Maurice" wrote: Yes, the dataentry options sets a new record. So best option is to lock the controls individually when you have opened the form. Remains the question why you want to set the form to data entry. Why not set the controls to locked once they are populated with the values. You could set them to me.textbox.locked=true. If you want to use some kind of loop for this you could use something like Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant Dim ctl As control varUnique = DMax("Key", "qryB_Update") for each ctl in me if ctl.tag = "some text" then ctl.locked=true end if next End Sub In this case you could place a text in the tag of the control. for instance "lock". replace the "some text" for the text you place in the tag of the control. hth -- Maurice Ausum "Tim" wrote: Maurice, Thanks for the response, but, I can't seems to get the code to work. Adding the me.DataEntry = True still locks the form down to a data entry only and doesn't show the fields populated by the query. There for it adds a new record in the table under the record with the record the data populated by the query. "Maurice" wrote: I'm assuming you are assigning the varUnique value to a certain field. If that's the case then add the following to your code Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant me.DataEntry=true '- add this line varUnique = DMax("Key", "qryB_Update") me.textbox=varunique '- if you want to assign it to a field... End Sub Remember this only works once because you've placed the code in the on open of the form.. hth -- Maurice Ausum "Tim" wrote: Is there a way to tell a Form to go to Data Entry = Yes, after you have populated two fields on a form? I am running.. Private Sub Form_Open(Cancel As Integer) Dim varUnique As Variant varUnique = DMax("Key", "qryB_Update") End Sub But, after it populates the form with the data from the query, I would like to lock the form down to a Data Entry form. Keeping the data the I filled with the above code. Thanks. |
Thread Tools | |
Display Modes | |
|
|