473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

automatically fill controls from a new open form

hey... i have a form with a cmd button that opens a 2nd form with acdialog as
the windowmode. upon opening, if certain fields are filled, i would like to
pull those values into some of the controls of the new form. here's the code
i have in the open even of the 2nd form:

If CurrentProject.AllForms("form1").IsLoaded = True Then
If IsNull(Forms!form1.Controls!txtboxdate) = False Then
Me.txtboxdate = Forms![form1].[txtboxdate]
End If
If IsNull(Forms!form1.Controls!txtboxbuyersfirstname) = False Then
Me.txtboxname = Forms![form1].[txtboxbuyersfirstname] & " " &
Forms![form1].[txtboxbuyerslastname]
End If
Me.cboxact.SetFocus
Else
Me.txtboxdate.SetFocus
End If

unfortunately, i'm being told by access that i can't set a value to this
object and the debugger is opened with this highlighted:

Me.txtboxdate = Forms![form1].[txtboxdate]

any clues? thanks.

--
Greg

Message posted via http://www.accessmonster.com
Apr 24 '06 #1
2 1802
Look at the control of Me.txtboxdate. Do you have an expression something
like = Date() there? If you have any kind of expression there, you can not
programatically set its value.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1175 users have come to me from the newsgroups requesting help
re******@pcdatasheet.com
"ka******@comcast.net via AccessMonster.com" <u15580@uwe> wrote in message
news:5f4700c66b1b6@uwe...
hey... i have a form with a cmd button that opens a 2nd form with acdialog
as
the windowmode. upon opening, if certain fields are filled, i would like
to
pull those values into some of the controls of the new form. here's the
code
i have in the open even of the 2nd form:

If CurrentProject.AllForms("form1").IsLoaded = True Then
If IsNull(Forms!form1.Controls!txtboxdate) = False Then
Me.txtboxdate = Forms![form1].[txtboxdate]
End If
If IsNull(Forms!form1.Controls!txtboxbuyersfirstname) = False Then
Me.txtboxname = Forms![form1].[txtboxbuyersfirstname] & " " &
Forms![form1].[txtboxbuyerslastname]
End If
Me.cboxact.SetFocus
Else
Me.txtboxdate.SetFocus
End If

unfortunately, i'm being told by access that i can't set a value to this
object and the debugger is opened with this highlighted:

Me.txtboxdate = Forms![form1].[txtboxdate]

any clues? thanks.

--
Greg

Message posted via http://www.accessmonster.com

Apr 25 '06 #2
"ka******@comcast.net via AccessMonster.com" <u15580@uwe> wrote in message
news:5f4700c66b1b6@uwe...
hey... i have a form with a cmd button that opens a 2nd form with acdialog
as
the windowmode. upon opening, if certain fields are filled, i would like
to
pull those values into some of the controls of the new form. here's the
code
i have in the open even of the 2nd form:

If CurrentProject.AllForms("form1").IsLoaded = True Then
If IsNull(Forms!form1.Controls!txtboxdate) = False Then
Me.txtboxdate = Forms![form1].[txtboxdate]
End If
If IsNull(Forms!form1.Controls!txtboxbuyersfirstname) = False Then
Me.txtboxname = Forms![form1].[txtboxbuyersfirstname] & " " &
Forms![form1].[txtboxbuyerslastname]
End If
Me.cboxact.SetFocus
Else
Me.txtboxdate.SetFocus
End If

unfortunately, i'm being told by access that i can't set a value to this
object and the debugger is opened with this highlighted:

Me.txtboxdate = Forms![form1].[txtboxdate]


I would simplify the code along the lines of

If CurrentProject.AllForms("form1").IsLoaded = True Then
If Not IsNull(Forms!form1.Controls!txtboxdate) Then Me.txtboxdate =
Forms![form1].[txtboxdate]
If Not IsNull(Forms!form1.Controls!txtboxbuyersfirstname) Then
Me.txtboxname = Forms![form1].[txtboxbuyersfirstname] & " " &
Forms![form1].[txtboxbuyerslastname]
Me.cboxact.SetFocus
Else
Me.txtboxdate.SetFocus
End If

It probably won't fix your problem but, as you code grows, it will be a
little easier to debug.

Regards,
Keith.
www.keithwilby.com
Apr 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: paul b | last post by:
Hello, I have a small problem in PHP an perhaps someone can help me: I have a simple HTML login page with a username and a password field, as well as a submit button, which I have to use for...
5
by: John Sheppard | last post by:
Hi there Does anyone know how to fill a bound textbox automaticlly. In an unbound textbox I would put in the control source =Sum(price, tax) (or some such function) and access updates it...
3
by: Sam | last post by:
Hi all, I have a splitter sitting between 2 panels (which I use for drawing) on my main form. The problem that I'm having is that when I resize my form, the panel(plnDwgContainer) that has the...
3
by: Stephen V | last post by:
Can anyone help me out with this problem. I would like to redirect/ go to another php page when my SQL insertion is done and also send a variable at the same time. the idea is, to come on my...
3
by: TheSteph | last post by:
Using : VS 2005, .NET 2.0, Windows Form, Win 2k I have a strange problem in VS : When I open some forms all the files (resx and cs) of this form are immediately marked as modified (an *...
0
by: Mark | last post by:
Hi, I'm new to ASP.Net, but not to c#, so I'm finding some things a little wierd in this internet based world, especially passing data from page to page. I have created a UserControl to...
4
by: MichaelK | last post by:
Hello. I have all data already collected on the current page? I want to open another window with the form, fill the fields and submit that form. So basically the question is how can I fill all...
1
by: menyki | last post by:
am still finding it difficult as a new java user. am designing a software that has multiple forms, controls such as combobox and so on and finding it difficult to do the following. i want some...
1
by: schlow09 | last post by:
Hey everyone, hoping someone could lend me a hand here... I'm trying to create a button in a form that will automatically send an email with a report. However this report can vary depending on the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.