A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Data Entry after Select Query



 
 
Thread Tools Display Modes
  #1  
Old October 9th, 2007, 10:05 PM posted to microsoft.public.access.forms
Tim
external usenet poster
 
Posts: 780
Default 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  
Old October 10th, 2007, 11:47 AM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default 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  
Old October 10th, 2007, 03:40 PM posted to microsoft.public.access.forms
Tim
external usenet poster
 
Posts: 780
Default 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  
Old October 10th, 2007, 05:23 PM posted to microsoft.public.access.forms
Maurice
external usenet poster
 
Posts: 1,585
Default 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  
Old October 10th, 2007, 05:49 PM posted to microsoft.public.access.forms
Tim
external usenet poster
 
Posts: 780
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.