3 questions regarding forms

zyzor

Banned
Local time
Yesterday, 22:23
Joined
Sep 26, 2008
Messages
64
I'm trying to create a form and encountered several problems while at it and I hope you can help me out.
(Sorry that I'm not familiar with the terms in english, but I'm using a localized version)

1. I'm trying to make certain text boxes appear or disappear according to wether a checkbox, which is linked to a table column, is checked or not, but I can't find a VB action which would work (most likely clicking on that default navigation bar at the bottom).

2. I want to make that project only accessable through the main form I made and by no other means, I tried saving the form as a "data access page" but it won't load the VB code. How can I accomplish that?

3. Not access related, but I'll ask anyway. The database I made was a replacement for another program's database which was made poorly for managing the items. I still need to use the original form which wasn't created by me for other purposes. Is there a way to link the text boxes of the different applications so that it won't be nessaccery to do double the work and input all the data twice?

Thanks a lot for all the help, it's greatly appreciated.
 
I'm trying to create a form and encountered several problems while at it and I hope you can help me out.
(Sorry that I'm not familiar with the terms in english, but I'm using a localized version)

1. I'm trying to make certain text boxes appear or disappear according to wether a checkbox, which is linked to a table column, is checked or not, but I can't find a VB action which would work (most likely clicking on that default navigation bar at the bottom).

.........

Try;
Code:
If Me.CheckBoxName.Value = -1 [COLOR="Green"]'-1 is equivalent to yes whilst 0 is equivalent to No[/COLOR]
     Me.TextBoxName.Visible = True
Else
     Me.TextBoxName.Visible = False
End If

.....

2. I want to make that project only accessable through the main form I made and by no other means, I tried saving the form as a "data access page" but it won't load the VB code. How can I accomplish that?

........

Firstly you can use the start up options to specify that your main opens when the DB starts. Depending on you version of access you could lock it up as an MDE or ACCDE file.

...........

3. Not access related, but I'll ask anyway. The database I made was a replacement for another program's database which was made poorly for managing the items. I still need to use the original form which wasn't created by me for other purposes. Is there a way to link the text boxes of the different applications so that it won't be nessaccery to do double the work and input all the data twice?

Thanks a lot for all the help, it's greatly appreciated.

Not sure but I suspect not.
 
Also note that the code John provided you needs to go in the combobox AfterUpdate event, as well as in the Form_Current event.`
 

As one never should input data twice, I am not sure that I understood your question.
If you need to share data between applications you just link the tables. A frontend can access several backend’s at the same time, as a matter of fact it doesn't matter where the data comes from. (If you use several PC’s you only need to assure that all applications/users access the backend’s through a network.)
You can also/even copy forms from another application, importing them, and link them to their original tables.
 
I took the OP's statement (and I suspect John did, also) "a replacement for another program's database" to mean that the other database was not an Access database but something else. If that's the case, whether the data from Access can be imported would depend on the other database program. And, in any case, it wouldn't be possible to "link the text boxes of the different applications so that it won't be nessaccery... (to) input all the data twice?"
 
Yeah, I can see why my wording was confusing.
What I ment was that an application which wasn't created stores its values in an access database (several others to be precise). I created another database to replace the database created by the application.
I was hoping for a way to continue using the original form of the original application, but to only replace the existing database with my own.

Try;
Code:
If Me.CheckBoxName.Value = -1 [COLOR=green]'-1 is equivalent to yes whilst 0 is equivalent to No[/COLOR]
     Me.TextBoxName.Visible = True
Else
     Me.TextBoxName.Visible = False
End If

The problem with that solution is that changing the checkbox through the navigation bar at the bottom doesn't trigger the afterupdate event of the checkbox.
 
Last edited:
how can you change the checkbox by using the navigation bar?
 
The checkbox is linked to a true/false table column.
So using the record navigation bar at the bottom changes it according to the active record.
 
then you want your code in the current event for the form

as you move between records, each change of record fires the current event

so in there you want, slightly modified from johnbigbooty's suggestion


Code:
if me.newrecord then
[COLOR="blue"]'presumably you want to see it if its a new record anyway[/COLOR]
 textboxname.visible=true
else
[COLOR="blue"]'use true/false rather than 0,-1[/COLOR]
 textboxname.visible = (checkboxname = true)
[COLOR="Blue"]'can also be expressed as just
' textboxname.visible = checkboxname[/COLOR]
end if

and you need similar code in the checkboxafter update event
 
Also note that the code John provided you needs to go in the combobox AfterUpdate event, as well as in the Form_Current event.`

and then;

then you want your code in the current event for the form

as you move between records, each change of record fires the current event

...........

Sorry I should have pointed that out, my bad :o
 
Well, recognizing that you have a problem, John, is half of the solution! :D
 

Users who are viewing this thread

Back
Top Bottom